StealJS: Multiple defines for anonymous module


#1

Hi everybody,

I got this error when i try to import module ( the MDBootstrap js).
TypeError: Multiple defines for anonymous module

Is there any way to solve it?

Thank you!


#2

I solved the problem (it seems… ) using this configuration in the package.json:

"meta": { "mdbootstrap": { "format": "global" } }

This permit to import the module with AMD without errors, but is it the correct way to do it?

Thank you!


#3

why do you think the module mdbootstrap is in AMD format?
the main javascript file that is the package.json points to js/mdb.min.js which is not a AMD version
the guide said that you have to put a link tag <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.2/js/mdb.min.js"></script> to use it. so it is obvious that it is not a AMD version.

configure that module as a “global” format is the right one.


#4

Thank @pYr0x.

The mdb.js includes other packages that use AMD (like the date picker): the AMD define in those module probably cause the problem I had because I’m using mdbootstrap like a module not including the script directly in my code.
This is what I mean to say: I didn’t say that mdboostrap is a AMD module, but only that using the “meta” I can import it using AMD without errors.