TypeScript complains about overwriting .d.ts files that are potentially known outputs
See original GitHub issueUsing tsc at the command line, I got
error TS5055: Cannot write file '/Users/alexamil/WebstormProjects/oresoftware/ldap-pool/index.d.ts' because it would overwrite input file.
why? 😃
my tsconfig.json file is as follows
{
"compilerOptions": {
"declaration": true,
"baseUrl": ".",
"types": [
"node"
],
"typeRoots": [
"node_modules/@types"
],
"target": "es5",
"module": "commonjs",
"noImplicitAny": true,
"removeComments": true,
"allowUnreachableCode": true,
"lib": [
"es2015",
"es2016",
"es2017"
]
},
"compileOnSave": false,
"exclude": [
"node_modules"
]
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:25 (7 by maintainers)
Top Results From Across the Web
Cannot write file 'index.d.ts' because it would overwrite input file
TypeScript error: Cannot write file 'index.d.ts' because it would overwrite input file · I excluded index.ts in tsconfig temporary to solve this issue...
Read more >Documentation - TypeScript 4.5
TypeScript 4.5 introduces a way to override a specific built-in lib in a manner similar to how @types/ support works. When deciding which...
Read more >TypeScript: cannot write file .d.ts because it would overwrite ...
json , yet TypeScript keeps using them as input and complaining that it can't overwrite them when generating type declarations.
Read more >Understanding TypeScript's “Compilation Process” & the ...
The TypeScript compiler compiles these files and outputs the JavaScript with .js ... The .d.ts file is a TypeScript declaration file, ...
Read more >TypeScript errors and how to fix them
error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. Broken Code ❌. index.d ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
At the very least there should be a flag that allows you to force an overwrite.
I also have this issue. I have turned
"declaration": true
and it complains about build folder already generated d.ts file when i run again tsc