Skip to content

tsc generating TS5055 error when generating declaration files #6046

@fuzing

Description

@fuzing

I'm consistently getting the following error when compiling any .ts file:
error TS5055: Cannot write file 'dist/[source-file-name].d.ts' because it would overwrite input file.

The compiler should be willing to overwrite the declarations files any time it recompiles. There are no permissions issues and this seems to be a new problem introduced recently since I moved from a stable ts1.7 release to using typescript@next releases (I'm currently on last night's - i.e. Version 1.8.0-dev.20151210).

I'm using tsc --watch with the following tsconfig.json file:

{
  "compilerOptions": {
    "target": "es6",
    "moduleResolution": "node",
    "module": "commonjs",
    "preserveConstEnums": true,
    "declaration": true,
    "noImplicitAny": false,
    "removeComments": true,
    "noLib": false,
    "sourceMap": false,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "outDir": "./dist"
  },
  "exclude": ["node_modules", "jspm_packages"],
  "filesGlob": [
    "./src/**/*.ts"
  ]
}

(NOTE - the filesGlob above is not appearing correctly due to github reformatting..... it is actually:
./src/[asterix][asterix]/[asterix].ts
just in case you thought I have a bad tsconfig)

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions