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:
- Uncaught SyntaxError: Cannot use import statement outside a module
- [Solved] node Error: SyntaxError: Cannot use import statement outside a module
- Gulp compression error: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module…
- vue VM682:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0
- How to Solve Import antd Error: Module build failed
- Celery Error: Did you remember to import the module containing this task?
- [Solved] Neo4j error: Import-Module & neo4j Neo.ClientError.Security.Unauthorized
- [Solved] HTML report error, httprunner 3. X HTML report error, oserror: [winerror 6] handle invalid (resolved)
- Hive Statement Error During Execution: Error while processing statement: FAILED: Execution Error, return code 2 from o
- ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_power:0 incompatib
- [Solved] Vite Bulk Import import.meta.glob Error: ERR_ABORTED 403 (Forbidden)
- [Solved] Python2 Install tensorflow Error: class DescriptorBase(metaclass=DescriptorMetaclass), SyntaxError: invalid syntax
- Keras-nightly Import package Error: cannot import name ‘Adam‘ from ‘keras.optimizers‘
- frida.InvalidArgumentError: script(line *): SyntaxError: unexpected end of string
- Testlink 1.9.16 Error: Fatal error: Uncaught Error: Cannot use string offset as an array in D:\softe
- Notes on atom editor_ (11) Editor previews HTML page in real time (add in: atom HTML preview)
- [Solved] Console error: syntax error: illegal return statement
- Solution: from. Import ft2font importerror: DLL load failed: the specified module cannot be found
- [Solved] Eslint error: /xxx/components/xxx import should occur after import of /xxx/utils/xxx