ES6 module support in Chrome 62/Chrome Canary 64, does not work locally, CORS error ES6 module support in Chrome 62/Chrome Canary 64, does not work locally, CORS error google-chrome google-chrome

ES6 module support in Chrome 62/Chrome Canary 64, does not work locally, CORS error


Unlike regular scripts, ES6 modules are subject to same-origin policy. This means that you cannot import them from the file system or cross-origin without a CORS header (which cannot be set for local files).

Basically you need to run this code from a (local) server or disable same-origin in the browser for testing (do not do this permanently). See: Access to Image from origin 'null' has been blocked by CORS policy.


I've run in the same problem, trying to import es6 code to launch in a html file in my browser, getting CORS errors in my browser console. If you have python on your machine one easy way to create a local server is to:

python3 -m http.server 8001

From the folder your are working in.