Hi everyone, my app works perfectly on http://localhost:5173 after running npm start. However, I need it to work locally on a Samsung TV. This means the app needs to run as static files, but I’m encountering issues with CORS in Google Chrome and other browsers.
I built the app using npm run build, which generated static assets, but when I try to open the app in the browser, I encounter the following error:
index.html:1 Access to script at ‘…/dist/index.js’ from origin ‘null’ has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: chrome, chrome-extension, chrome-untrusted, data, http, https, isolated-app.
How can I configure the app to run correctly as static files for this use case? Do I need to adjust vite.config.js or use a specific setup to avoid this CORS issue? Any guidance would be greatly appreciated!