Topic: requirejs problem
when loading mdb.js with require.js in my project developertool says "Uncaught ReferenceError: Waves is not defined"
commenting like below causes problems as well
/*
Waves.attach('.btn:not(.btn-flat), .btn-floating', ['waves-light']);
Waves.attach('.btn-flat', ['waves-effect']);
Waves.attach('.chip', ['waves-effect']);
Waves.attach('.view a .mask', ['waves-light']);
Waves.attach('.waves-light', ['waves-light']);
Waves.attach('.navbar-nav a:not(.navbar-brand), .nav-icons li a, .nav-tabs .nav-item:not(.dropdown)', ['waves-light']);
Waves.attach('.pager li a', ['waves-light']);
Waves.attach('.pagination .page-item .page-link', ['waves-effect']);
Waves.init();
*/
Uncaught TypeError: Cannot read property 'defaults' of undefined at mdb.js:23681
any suggestions?
ozcelebi answered 6 years ago
negative, the code below causes "Uncaught TypeError: Cannot read property 'defaults' of undefined at mdb.js:23681" error
'use strict';
define(
['mdb'],
function() {
}
);
and the config file
var require = {
baseUrl: "/static/js",
paths: {
'require': 'lib/require',
'jquery': 'lib/jquery-3.3.1.min',
'bootstrap': 'lib/bootstrap.bundle.min',
'mdb': 'lib/mdb',
},
shim: {
"bootstrap": {
deps: ['jquery']
},
"mdb": {
deps: ['bootstrap']
},
}
};
Piotr Glejzer staff commented 6 years ago
I added that problem to our 'bug todo list' to don't forget to resolve that. We are sorry about that. We will try to resolve that problem as soon as possible. Have a nice day.
Marta Szymanska staff pro premium answered 5 years ago
Hi,
Is this bug still exist in your project?
Best, Marta
ozcelebi commented 5 years ago
It actually does.
MDBootstrap staff pro premium priority commented 5 years ago
Does updating your mdb package helps?
ozcelebi commented 5 years ago
With "Version: MDB Pro 4.8.5" and bootstrap version 4.3.1
still we get "Uncaught ReferenceError: Waves is not defined" error
MDBootstrap staff pro premium priority commented 5 years ago
Thanks for your information about this topic. We will further investigate this issue from scratch.
ozcelebi commented 5 years ago
I added the following code line jQuery.fn.pickadate = jQuery.fn.pickadate || {}; after disabling wavesthis time I could get it loaded without errors but that time I could not access toastr :)
MDBootstrap staff pro premium priority commented 5 years ago
Right now I honestly don't understand this behaviour of our package in your environment. I will forward this information to find a solution.
MDBootstrap staff pro premium priority answered 5 years ago
Hi ozcelebi,
I test require js with mdb initialization. Can you show me require js config file and all the dependencies that you are using with it? How do you implement mdb.js and with which dependencies? Require js works with very specific file structure and defined dependencies. Can you show me how you initiate mdb elements with this library? I will try to find solution to this case.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.5.10
- Device: Computer
- Browser: Chrome
- OS: Linux
- Provided sample code: Yes
- Provided link: No
Piotr Glejzer staff commented 6 years ago
Hello,
Is this error only show when you are using that waves js initiate code?