Thanks again for the response @ZachSaucier !! I really appreciate you taking the time! I followed your advice and am now loading the UMD versions of MorphSVG and ScrollTrigger while still loading the CDN version of GSAP core. Unfortunately i'm still getting the same error. Here's what my script tags look like:
<!-- This is a reference to my main js file... which is NOT in module form -->
<script src="https://www.xxxxxxx.org/xxxx/main.js"></script>
<script> require(['https://cdnjs.cloudflare.com/ajax/libs/gsap/3.5.1/gsap.min.js'], function (GS) {
console.log('GreenSock is here', GS);
wunder.libraryLoaded();
});
</script>
<script> require(['https://www.xxxxxxx.org/xxxx/gsap-shockingly-green/umd/MorphSVGPlugin.js'], function (MorphSVGPlugin) {
console.log('MorphSVGPlugin: ', MorphSVGPlugin);
wunder.libraryLoaded();
});
</script>
<script> require(['https://www.xxxxxxx.org/xxxx/gsap-shockingly-green/umd/ScrollTrigger.js'], function (ScrollTrigger) {
console.log('ScrollTrigger: ', ScrollTrigger);
wunder.libraryLoaded();
});
</script>
Here's what the error message looks like:
You can see that the 3 gsap libraries all get loaded successfully.
My code waits for all three libraries to load, then begins.
The red error above is when i call gsap.registerPlugin(ScrollTrigger, MorphSVGPlugin);
Here's my code that waits for the 3 libraries to load... then calls gsap.registerPlugin:
libraryLoaded: function(library) {
wunder.libraryCount +=1;
if (wunder.libraryCount === 3) {
gsap.registerPlugin(ScrollTrigger, MorphSVGPlugin);
wunder.setup();
wunder.resizeListener();
}
},
Again. The issue is intermittent but happens everytime i open a new tab and load the site in Chrome and Firefox (Safari seems to always work).
If i just keep refreshing the site in chrome (no hard refresh) I'll see the issue 1 out of 4 times... Which makes me think it could be some kind of race condition?
Thanks for any help or further direction setting.