Error: error TS5055: Cannot write file '...' because it would overwrite input file.
See original GitHub issueSearch terms
> typechecker@7.17.0 our:meta:docs:typedoc
> rm -Rf ./docs && typedoc --exclude '**/+(*test*|node_modules)' --excludeExternals --out ./docs ./source
Error: error TS5055: Cannot write file '/Users/balupton/Projects/auto-fixes/typechecker/test-fixtures/async.js' because it would overwrite input file.
Error: error TS5055: Cannot write file '/Users/balupton/Projects/auto-fixes/typechecker/test-fixtures/classes-compiled.js' because it would overwrite input file.
Error: error TS5055: Cannot write file '/Users/balupton/Projects/auto-fixes/typechecker/test-fixtures/classes.js' because it would overwrite input file.
Error: error TS5055: Cannot write file '/Users/balupton/Projects/auto-fixes/typechecker/test-fixtures/index.js' because it would overwrite input file.
Error: error TS5055: Cannot write file '/Users/balupton/Projects/auto-fixes/typechecker/test-fixtures/map-empty.js' because it would overwrite input file.
Error: error TS5055: Cannot write file '/Users/balupton/Projects/auto-fixes/typechecker/test-fixtures/map.js' because it would overwrite input file.
Error: error TS5055: Cannot write file '/Users/balupton/Projects/auto-fixes/typechecker/test-fixtures/weakmap-empty.js' because it would overwrite input file.
Error: error TS5055: Cannot write file '/Users/balupton/Projects/auto-fixes/typechecker/test-fixtures/weakmap.js' because it would overwrite input file.
Expected Behavior
those files to be ignored due to the --exclude
pattern
Actual Behavior
didn’t work
Steps to reproduce the bug
git clone https://github.com/bevry/typechecker.git
cd typechecker
npm install
npm run our:release:prepare
Environment
- Typedoc version:
0.21.4
- TypeScript version:
4.3.5
- Node.js version:
16.5.0
- OS:
Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 x86_64
- m1 mac mini 11.5.1 (20G80)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9
Top Results From Across the Web
visual studio - Typescript error "Cannot write file ... because it ...
Cannot write file 'C:/{{my-project}}/node_modules/buffer-shims/index.js' because it would overwrite input file. It looks like this all the time.
Read more >Cannot write file because it would overwrite input file TS
The error "Cannot write file because it would overwrite input file" occurs when we haven't specified the outDir directory in the exclude array...
Read more >Error "Cannot write file ... because it would overwrite input file."
This happens when the declaration files are not excluded from the build. Whenever this occurs, the builder tries to build the existing ".d.ts" ......
Read more >TypeScript: cannot write file .d.ts because it would overwrite ...
The reason you have this error in the first place is likely because you're writing actual JavaScript and generating types from JSDoc. One...
Read more >Error “Cannot write file … because it would overwrite input file.”
In this post am going to share with you the irritating typescript warnings and how it was solved for me. Below is the...
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 Free
Top 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
TypeDoc’s behavior matches the behavior of
npx tsc
, which is expected.Running
npx tsc --explainFiles
shows that your include pattern of “source” means that “source/test.ts” is included in the program, which means that all the files in test-fixtures are also included. If you change the include pattern to only include source/index.ts, TypeScript (and therefore TypeDoc) won’t look at your test-fixtures directory.Alternatively, set a output directory with
"outDir": "dist"
in your tsconfig and TypeScript will no longer have this error since it won’t be trying to write JS files into the same directory they were discovered from.Solved by adding
"exclude": ["test-fixtures", "node_modules", "source/test.ts"]
to tsconfig, and// @ts-ignore
to the fixture files