ES6 modules are subject to same-origin policy.
You need to run your script from a local server, opening the file directly with a browser will not work.
see here ES6 module support in Chrome 62/Chrome Canary 64, does not work locally, CORS error
More Related Contents:
- What’s the difference between using “let” and “var”?
- How to update nested state properties in React
- How to load external scripts dynamically in Angular?
- Curly Brackets in Arrow Functions
- How to destructure into dynamically named variables in ES6?
- Which browsers support import and export syntax for ECMAScript 6?
- ECMAScript 2015: const in for loops
- What is the difference between “let” and “var”?
- ES6: import module from URL
- ES6 module Import giving “Uncaught SyntaxError: Unexpected identifier”
- Override a setter, and the getter must also be overridden
- Nested ES6 classes?
- Usage of rest parameter and spread operator in javascript
- Why can I not use `new` with an arrow function in JavaScript/ES6?
- JavaScript – Map() increment value
- React.js ES6 avoid binding ‘this’ to every method
- JSON stringify a Set
- ES6 Tail Recursion Optimisation Stack Overflow
- ES6 Class Multiple inheritance
- What is the purpose of template literals (backticks) following a function in ES6?
- Call a child method from a parent class in ES6
- Find all values by specific key in a deep nested object
- Export multiple classes in ES6 modules
- String interpolation on variable
- require(‘babel/register’) doesn’t work
- Why does .then() chained to Promise.resolve() allow const declaration to be reassigned?
- Is it possible to export Arrow functions in ES6/7?
- Javascript – Template Strings Don’t Pretty Print Objects
- How can the current number of i be accessed in a for of loop?
- How to bind methods when destructuring an object in JavaScript?