Skip to content

TypeScript complains about overwriting .d.ts files #35541

Closed
@sguillia

Description

@sguillia

TypeScript Version: Version 3.8.0-dev.20191206

Search Terms: overwrite .d.ts declaration

Steps to reproduce

The repo is a minimal working example and contains practically no code.

git clone https://github.com/sguillia/ts-bug-repro
cd ts-bug-repro
tsc -p . # Ignore error about missing .d.ts
tsc -p .

Expected behavior:

Compiles without error, by ignoring the dist folder as specified in the tsconfig.json.

Actual behavior:

The second tsc run spits out an error.

error TS5055: Cannot write file '/home/user/ts-bug-repro/dist/main.d.ts' because it would overwrite input file.

Found 1 error.

Related Issues:

Not a valid duplicate because it is old, misses version information and misses easy-to-reproduce steps
#16749

Look for error TS5055. The FAQ mentions this error but takes the assumption that we have allowJs which is untrue in my case.
https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions