mdbootstrap / material-design-for-bootstrap

Important! A new UI Kit version for Bootstrap 5 is available. Access the latest free version via the link below.
https://mdbootstrap.com/docs/standard/
MIT License
9.34k stars 1.15k forks source link

RequireJS / BackboneJS MDB Pro Fails to Load #203

Open AlexDuvanenko opened 5 years ago

AlexDuvanenko commented 5 years ago

Expected behavior

When upgrading from the free version to the pro version, there shouldn't be any errors using RequireJS.

Actual behavior

When upgrading from the free version to the pro version, getting lots of mismatched anonymous define() module errors, Waves is not defined errors in mdb.min.js, cannot read property 'defaults' of undefined errors, etc. The free version seemed to work just fine, minus the Waves is not defined, but when implementing the Pro version of MDB, we're getting lots of errors.

Your working environment and MDB version information

MDB Pro - v 4.5.14 RequireJS -

Resources (screenshots, code snippets etc.)

console

Sample requirejs config that is not working. ` requirejs .config({ baseUrl : 'js/application', priority : [ 'jquery' ], waitSeconds : 2000, urlArgs: "v=" + dateStamp, paths : {
'jquery' : 'jquery/jquery-3.2.1.min', 'bootstrap' : 'plugins/bootstrap.bundle.min', 'mdb' : 'plugins/mdbootstrap/mdb.min'
}, shim : { 'jquery' : {},

             'bootstrap' : {
                 deps : [ 'jquery' ]
             },
             'mdb' : {
                 deps : ['bootstrap', 'jquery']
             },

         }
     });

requirejs.onError = function(err) { var errorMsg = err.requireType + ": '" + err.message + "' in " + err.fileName + " on Line: " + err.lineNumber; console.error(errorMsg); }; requirejs([ 'app', 'backbone', 'jquery', 'bootstrap', 'mdb'], function(app, backbone,$,bootstrap, mdb) { 'use strict';

 app.initialize();

}); ` For every question of technical nature, in order to get the most detailed answer as soon as possible, ask on our dedicated Support Forum

zsyphon commented 5 years ago

Great question! I'm having the same problem and have yet to resolve it.

I've followed the suggestions in this post, but nothing is working.

https://mdbootstrap.com/support/general/proper-structure-for-using-with-requirejs-urgent/

mattonit commented 5 years ago

We were asked about integration with Require JS many times, but we didn't try it yet. I cannot promise you guys if this will happen soon. However, I'll leave this issue open so maybe one day someone will find a solution for this issue