cannot use import statement outside a module
Fix error

Fix – Cannot use import statement outside module in JS or TypeScript

The “Uncaught syntaxerror: Cannot use import statement outside a module” occurs in JavaScript and Typescript when you apply the ES6 Modules concept/syntax in a particular script that’s not loaded as a local or third-party module. This happens as a result of importing ECMAScript 6 that is exported as a function or a class in a different file. Also, when linking…

Continue Reading