Answers for "cannot use import statement outside a module typescript"

6

Cannot use import statement outside a module

<script type="module" src="main.js"></script>
Posted by: Guest on November-11-2020
3

cannot use import statement outside a module typescript

// Fix 1
Change .js files to .cjs
// Fix 2
Add "type": "module" to package.json
Posted by: Guest on December-03-2020
0

cannot use import statement outside a module

//Add type=module to your index.js script tag (not just the package script tag)

<script type="module" src="./index.js"></script>
Posted by: Guest on September-26-2021
-2

typescript mocha Cannot use import statement outside a module

"test": "env TS_NODE_PROJECT=\"tsconfig.testing.json\" mocha --require ts-node/register 'src/test/**/*.ts'",
Posted by: Guest on July-12-2020

Code answers related to "cannot use import statement outside a module typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language