Uncaught Error: Mismatched anonymous define() module: function ()...

Krysta Hunt asked on March 30, 2017 03:17

I am trying to load ScrollMagic, TweenMax, into my header on a single page in my site. Im using a javascript widget loaded into the design, and placing multiple script tags inside the inline section, loading inline and not generating script tags.

these are dependencies for script tags further down the page, I am NOT loading in require.js but I get several errors for items I am attempting to load Uncaught Error: Mismatched anonymous define() module: function () indicating that whatever is compiling these files into one allScripts.min.js file is using AMD to try to load them, this is really screwing with me being able to get this page working, is there a better way to load in these files so they are not being clumped together? New to Kentico and not a genius when it comes to AMD or require in general, I dont even know if Kentico is using require or Nuget or what to do this.. please forgive my ignorance.

Recent Answers


Brenden Kehren answered on March 30, 2017 14:24

If your loading your jquery library AFTER those other libraries that could be the problem. I'd suggest loading the ScrollMagic and TweenMax libraries at the end of the page after you're allfiles.js file or wherever your jquery library is loaded.

0 votesVote for this answer Mark as a Correct answer

Krysta Hunt answered on March 30, 2017 22:59 (last edited on March 30, 2017 23:01)

Im getting most of these files giving a mismatched anonymous define error.

 <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenMax.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/ScrollMagic.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/plugins/animation.gsap.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/plugins/jquery.ScrollMagic.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/plugins/debug.addIndicators.js"></script>
    <script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>

primarily with ScrollMagic not being defined

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on March 31, 2017 02:47 (last edited on March 31, 2017 15:01)

First off remove the protocol on the URL so they just read //cdnjs.cloudflare.com.....

Secondly, where are you loading jquery or your require.js file(s) in at? is it above the TweenMax.min.js file?

0 votesVote for this answer Mark as a Correct answer

Krysta Hunt answered on March 31, 2017 19:16

Yes, It is above the TweenMax.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.