While compiling the transpiled ES6 JS files from TS (React), I ran into this error:
Cannot get final name for export '__esModule' of ./src/App.js while generating the root export '__esModule' (used name: '__esModule')
This is my tsconfig.json
"compilerOptions": {
"jsx": "react",
"target": "es6",
"lib": ["dom", "esnext"],
"module": "commonjs",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
I was not able to find a relevant explanation online after hours of scouring. Any help is appreciated.
In your tsconfig.json file, change the "module" to "ESNext" like this:
{
"compilerOptions": {
"module": "ESNext",
}
}