Consonle error: Cannot use import statement outside a module (at main.js:2:1) #1648
Answered
by
smolenski-mikolaj
sussweb
asked this question in
Support from community
-
Hi, Any ideas what I am doing wrong? main.js
This is my package.json
|
Beta Was this translation helpful? Give feedback.
Answered by
smolenski-mikolaj
May 12, 2023
Replies: 1 comment 1 reply
-
@sussweb your main.js file should be imported inside html file as a
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sussweb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@sussweb your main.js file should be imported inside html file as a
module
, not as atext/javascript
, so it should be:<script type="module" src="PATH_TO_YOUR_MAIN_JS_FILE"></script>