Hello i’m using DatoCMS to upload mp4 videos or images to use as mapped textures with three.js in my vue + nuxt project.
But currently SOMETIMES, im getting a CORS error like so:
For images Access to image at 'https://www.datocms-assets.com/....examplepath here....png' from origin 'https://myurl.here' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://myurl.here' that is not equal to the supplied origin
For videos: Access to fetch at 'https://stream.mux.com/....pathhere.../medium.mp4' from origin 'https://myurl.here' has been blocked by CORS policy: Request header field range is not allowed by Access-Control-Allow-Headers in preflight response.
Strangely, this problem happens sometimes, usually on first load. And if i have my chrome dev tools open, with ‘disable cache’ checked, this problem goes away. This happens on my localhost and also when i host it on netlify too
I’ve even tried adding crossorigin=“anonymous” attributes to the video element but this didnt solve anything.
Unfortunately this is fairly urgent If anyone has any idea how to solve this, i’ll be grateful!