4 ms·
You don't need file:// module URLs when you say open a index.html from your local drive through file://C:/index.html but then in that index.html you have a 'scr
by tpm 2y ago
You don't need file:// module URLs when you say open a index.html from your local drive through file://C:/index.html but then in that index.html you have a 'script type="module" src="src/index.js"' and from there you go through usual relative paths without protocol.
This works in Firefox, I have one project open like that right now. Chrome blocks that because of their CORS policy, but that's another issue, can be mitigated by some commandline options (--allow-file-access-from-files --cors-exempt-headers "*")
- matt_kantor 2y ago> Chrome blocks that because of their CORS policy Firefox has the same behavior (I just tested using Firefox 136 on macOS). The error message says "CORS request not HTTP"[0]. You might have disabled `security.fileuri.strict_origin_policy` in about:config? [0]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS/Errors/CORSRequestNotHttp https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/COR...
- tpm 2y agoYeah, happened long ago so I didn't remember it. Still for dev env I think it's a reasonable tradeoff.