material-design-for-bootstrap icon indicating copy to clipboard operation
material-design-for-bootstrap copied to clipboard

RequireJS / BackboneJS MDB Pro Fails to Load

Open AlexDuvanenko opened this issue 6 years ago • 2 comments

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

AlexDuvanenko avatar Dec 03 '18 15:12 AlexDuvanenko

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/

zsyphon avatar Dec 03 '18 15:12 zsyphon

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

mattonit avatar Dec 06 '18 07:12 mattonit