I have this three files:
script.js
alert("script")
module.mjs
alert("module")
and index.html
<script src="./script.js"></script>
<script src="./module.mjs" type="module"></script>
No server is running.
If I open the browser and navigate to my local index.html file, I can see the scripts alert being displayed but the module is blocked by cross origin policy.
Both Chrome and Firefox show the same behavior but I'm accessing all the files from my local environment, so why they say that there is a cross origin policy violation in one case and not in the other?
A partial reason can be found here but in my case the script.js is loaded, why the cross origin policy is applied only on ES6 modules?