[Solved] HTML_Uncaught SyntaxError: Cannot use import statement outside a module

Solution:
you need to add the attribute type = “module” on the script tag

<script type="module">
	import {name} from './js'
	console.log(name)
</script>

Read More: