javascript - Mismatched anonymous define() module -
i'm getting error when browse webapp first time (usually in browser disabled cache).
error: mismatched anonymous define() module: function (require) {
html:
<html> . . . <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> var require = { urlargs: "v=0.4.1.32" }; </script> <script data-main="assets/js/main" src="assets/js/libs/require.js"></script> <script src="assets/js/ace/ace.js?v=0.4.1.32"></script> </body> </html>
js:
$(function () { define(function (require) { // }); });
anyway know error mean , why happening?
source file, short discussion in github issues page
like alienwebguy said, per docs, require.js can blow up if
- you have anonymous define ("modules call define() no string id") in own script tag (i assume mean anywhere in global scope)
- you have modules have conflicting names
- you use loader plugins or anonymous modules don't use require.js's optimizer bundle them
i had problem while including bundles built browserify alongside require.js modules. solution either:
a. load non-require.js standalone bundles in script tags before require.js loaded, or
b. load them using require.js (instead of script tag)
Comments
Post a Comment