Access to Script at ' from origin 'null' has been blocked by CORS policy
11/27/2020 6:05:29 PMKarak10
2 AnswersNew Answer
For security reasons, scripts that run on a browser may not make requests to the file system. You can start a Node server on your local machine. If you load the page with http or https protocol, EcmaScript modules will work. If you prefer to use the file:// protocol, you should consider transpiling your EcmaScript code with Babel to something compatible with most browsers.
A beginner's friendly way to fix that is to download the "bracket editor" and open your page using "live preview". This automatically create a server at the location 127.0.0.1:port and let's you practise module without stress. The difficult method is to buy a server or subscribe to their free plan, host your files and start working from there.