Closed
Description
TypeScript Version: 3.2.0-dev.20181027
Search Terms: json isolatedModules
, resolveJsonModule isolatedModules
Code
import test from './test.json'
tsconfig.json
:
{
"compilerOptions": {
"target": "es5",
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve"
},
"include": [
"src"
]
}
Expected behavior:
Imports JSON without any error.
Actual behavior:
TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
Playground Link: Could not find a playground that supports editing tsconfig.json, adding a json file and that would show tsc output
Related Issues: #15230, #18232, https://stackoverflow.com/q/52103265/2228575