Closed
Description
TypeScript Version: 3.0.0-dev.20180605
Search Terms: TS5055 resolveJsonModule
Code
tsjson> find .
.
./main.ts
./json
./json/myjson.json
./tsconfig.json
./src
./src/test.ts
tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"baseUrl": "./",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"noEmitOnError": true
},
"include": [
"main.ts",
"src",
"json"
],
"exclude": [
"node_modules"
]
}
main.ts:
import "test";
src/test.ts:
import myjson from "json/myjson.json";
console.log('hello world!', myjson.message);
export {}
json/myjson.json:
{
"message": "to be continue..."
}
Expected behavior:
compile successful
Actual behavior:
tsjson> tsc
error TS5055: Cannot write file '*************/tsjson/json/myjson.json' because it would overwrite input file.
Playground Link:
Related Issues: