TS5055

error TS5055: Cannot write file ‘/Users/bennyn/projects/wireapp/wire-webapp-lru-cache/dist/commonjs/LRUCache.d.ts‘ because it would overwrite input file.

Bad Code ❌

tsconfig.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": true,
"outDir": "dist/commonjs",
"removeComments": true,
"rootDir": "src/main/ts",
"sourceMap": false,
"target": "es5"
},
"exclude": [
"bower_components",
"node_modules",
"typings/browser",
"typings/browser.d.ts"
]
}

Fixed Code ✔️

tsconfig.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": true,
"outDir": "dist/commonjs",
"removeComments": true,
"rootDir": "src/main/ts",
"sourceMap": false,
"target": "es5"
},
"exclude": [
"bower_components",
"dist/commonjs",
"node_modules",
"typings/browser",
"typings/browser.d.ts"
]
}