I used the Custom Elements feature in Wix, to implement Lottie animation. However, the animation does not load on the live Wix site.
This is what Wix Developers had to say:
in this case, it’s a race condition between
requirejs lib that the viewer loads and
you can see the correlation between the missing element and the
Error: Mismatched anonymous define() in the console.
here is what requirejs recommends:
• Be sure to load all scripts that call define() via the RequireJS API. Do not manually code script tags in HTML to load scripts that have define() calls in them.
• If you manually code an HTML script tag, be sure it only includes named modules, and that an anonymous module that will have the same name as one of the modules in that file is not loaded.
it means that lottie should either:
• expose a non umd/amd module, or
• expose named (and not anonymous) modules in their amd bundle
Wix are saying we need to ask LottieDevs to expose a named define?