Access to script at 'file:///.../index.js' from origin 'null' has been blocked by CORS policy: The response is invalid. How to use ES6 Modules?
-
-
Edge and Firefox can do this and only Chrome thinks that I need to start a webserver everytime... Old "nomodules" work fine
-
file: isn't web compatible. Anything you test with file: may not reflect how it'll work on the web.
- 6 more replies
New conversation -
-
-
Yeah, that's what I meant. The file protocols lack of things like CORS is what prevents module loading from working.
-
@Yaffle Depending on what you're actually wanting to do where you know you have access to certain `file:///` urls, you could use Puppeteer and use request interception to enable CORS responses from those `file:///` urls.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.