Answer the question
In order to leave comments, you need to log in
How to properly import npm modules into browser js?
I have a js code that needs to be run in a browser, with the following syntax:
import { something } from 'module1'
import { something } from 'module2'
...
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
. On the Internet, unfortunately, I did not find anything sensible about this.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question