Cannot use import statement outside a module
Closed this issue · 1 comments
dnaicker86 commented
I know this is a generic error related to typescript but just wanted to find some closure as to the resolution.
C:\Users\DNaicker\Github\AriesJS\aries-js-project-1\node_modules\react-native\index.js:14
import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
^^^^^^
SyntaxError: Cannot use import statement outside a module
Project code available at:
https://github.com/dnaicker86/aries-js-project-1
I have added tsconfig,json
file with the following:
{
"compilerOptions": {
"module": "ESNext",
"esModuleInterop": true,
"target": "ESNext",
"moduleResolution": "Node",
"outDir": "dist",
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"isolatedModules": false,
"strict": true,
"noImplicitAny": true,
"useUnknownInCatchVariables": false,
"inlineSourceMap": true
},
"ts-node": {
"esm": true
},
"lib": ["esnext"]
}
i have added to package.json
"type": "module"
berendsliedrecht commented
This is not related to AFJ so I will close this for now.