Hello everyone, I'm reaching out to seek some assistance with a CORS issue that's causing problems with our web application. Here's a brief overview of the problem:
Issue Description:
We have developed a web app that needs to run in SPA mode with SSR set to false. It works on live server. However, when we attempt to open the app (/dist/index.html) using the file protocol (we need it so it works on the client device), we encounter the following CORS errors:
Access to script at 'file:///C:/[path]/app/dist/_nuxt/entry.0617e852.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
Failed to load resource: net::ERR_FAILED
Additional Information:
We are not doing any API calls, we just generate a basic Nuxt app.
We have already tried updating the headers with the Nuxt Security module, like so:
security: {
corsHandler: {
origin: 'file://',
methods: '*',
allowHeaders: '*',
exposeHeaders: '*',
credentials: true
}
},
If you need more details about our configuration or code, please let us know, and we'll provide them promptly.
Thank you in advance for your assistance!