0
how do i import a module in javascript
am trying to import a module in javascript but getting an error #'Uncaught SyntaxError: Unexpected token import'
2 odpowiedzi
+ 1
Here is more about import https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
It will be good if you post example of your code here, and module what you importing, so we can see what is problem.
Syntax error mostly means some typo or some wrong syntax
+ 1
Import is a keyword for ES6, if you don’t have a transpiler to CommonJS use require(‘your module’)