Hello everyone,
I cannot get my Dotlottie player to work. I tried two methods.
Method 1:
I get these errors:
-Access to script at ‘https://unpkg.com/@dotlottie/player-component@latest/dist/dotlottie-player.mjs’ from origin ‘http://localhost:8888’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
-GET […same url as in error above…] net::ERR_FAILED 520
My code:
Method 2
After this I installed dotlottieplayer via npm in the terminal. I imported the script:
And included it in my main.js file:
import ‘@dotlottie/player-component’;
Then i get this error:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/plain”. Strict MIME type checking is enforced for module scripts per HTML spec.
What am I doing wrong here?
Thanks in advance for any advice!
(p.s. I could not paste all the urls in this post because I was not allowed to post more than two urls as a new user…)