envs
envs copied to clipboard
React native typescript compiler - Cannot find namespace 'JSX'
I am facing error when trying to build my component with new react-native-typescript compiler. I get a lot of errors.
- Cannot find namespace 'JSX'
- Cannot find module 'react' or its corresponding type declarations.
- Cannot find module 'moment' or its corresponding type declarations.
- Cannot find module 'react-native' or its corresponding type declarations.
Steps to Reproduce
My bit.json (compiler part) looks like this:
"bit.envs/compilers/[email protected]": {
"dependencies": {
"@types/react": "^16.9.23",
"@types/react-native": "^0.61.17"
},
"rawConfig": {
"compilerPath": "typescript/bin/tsc",
"compilerArguments": ["--declaration"],
"compiledFileTypes": [".ts", ".tsx"],
"configFileName": "tsconfig.json",
"tsconfig": {
"compilerOptions": {
"outDir": "dist",
"allowJs": true,
"target": "es5",
"module": "commonjs",
"strict": false,
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"typeRoots": [
"./node_modules/@types"
]
},
"exclude": ["./node_modules/**/*"]
},
"development": true,
"copyPolicy": {
"ignorePatterns": ["package.json", "package-lock.json", "tsconfig.json"],
"disable": false
}
}
}
Expected Behavior
Maybe I am using this configuration wrong.
Specifications
- Bit version: 14.7.6
- Node version: 10.18.1
- npm version: 6.13.4
- Compiler / Tester (include version): [email protected]