importing ES6 modules in browser environement - hogehoge666/syno_moments_slider GitHub Wiki

importing ES6 modules in a browser environment causes error.

First of all, you need to make sure you are using a Live Server. If you are accessing local file(file://) it would cause CORS error.

You need "type="module" in script tag.

<script src="./index.js" type="module"></script>

You also need .js extension in the import statement.

import MyClass from './my-module.js'
⚠️ **GitHub.com Fallback** ⚠️