N
Nuxt2mo ago
Inès

CORS error on CSS?

Hi, With Nuxt3.11 I have set in my nuxt config a custom cdnUrl. With that set, I keep on having CORS errors in my console for CSS files:
Subresource Integrity: The resource 'https://MY-CUSTOM-CDN-URL/_nuxt/entry.4zpP3XJs.css' has an integrity attribute, but the resource requires the request to be CORS enabled to check the integrity, and it is not. The resource has been blocked because the integrity cannot be enforced.
Subresource Integrity: The resource 'https://MY-CUSTOM-CDN-URL/_nuxt/entry.4zpP3XJs.css' has an integrity attribute, but the resource requires the request to be CORS enabled to check the integrity, and it is not. The resource has been blocked because the integrity cannot be enforced.
I should specify that my application runs on the same domain, but not the same subdomain as my CDN (both of them are under my responsibility). And it also seems to happen only on components/pages that are not server-side rendered, but I can't change that at the moment. Do you know what I could change to remove these errors and have my CSS correctly applied? Thanks!
1 Reply
Inès
Inès2mo ago
I also use nuxt-security and already checked the https://nuxt-security.vercel.app/documentation/utils/subresource-integrity. Even when disabling the sri option it doesn't work... Moreover I don't think this is something suitable for production so I put it back either way
Want results from more Discord servers?
Add your server