Skip to content

Unexpected TS5055 error "Cannot write file X because it would overwrite input file" #62475

@JounQin

Description

@JounQin

🔎 Search Terms

  • TS5055
  • overwrite input file

🕗 Version & Regression Information

  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

No response

💻 Code

// <rootDir>/tsconfig.base.json
{
  "compilerOptions": {
    "declaration": true,
    "jsx": "react-jsx",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "strict": true,
    "target": "ESNext",
    "rewriteRelativeImportExtensions": true,
    "stripInternal": true,
    "verbatimModuleSyntax": true
  }
}
// <rootDir>/tsconfig.json
{
  "extends": "./tsconfig.base",
  "compilerOptions": {
    "noEmit": true,
    "paths": {
      "@alauda/doom/config": ["./packages/doom/src/config.ts"],
      "@alauda/doom/runtime": ["./packages/doom/src/runtime/index.ts"],
      "@alauda/doom/theme": ["./packages/doom/src/theme/index.ts"],
      "@alauda/doom-export": ["./packages/export/src/index.ts"]
    }
  },
  "references": [
    {
      "path": "./packages/export"
    },
    {
      "path": "./packages/doom"
    }
  ],
  "mdx": {
    "checkMdx": true
  }
}

Source structure:

packages
├── doom
│   ├── lib
│   ├── src
│   └── tsconfig.json
└── export
    ├── lib
    ├── src
    └── tsconfig.json
// <rootDir>/packages/<pkg>/tsconfig.json
{
  "extends": "../../tsconfig.base",
  "compilerOptions": {
    "composite": true,
    "noEmit": false,
    "outDir": "lib",
    "rootDir": "src"
  },
  "include": ["src"]
}

🙁 Actual behavior

Run yarn tsc -b first, change any file in packages/doom, and run yarn tsc -b again.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/api/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/api/types.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/auto-sidebar/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/auto-sidebar/type.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/auto-sidebar/walk.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/auto-toc/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/directives/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/global/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/mermaid/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/permission/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/permission/types.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/replace/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/replace/normalize-img-src.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/replace/types.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/replace/utils.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/shiki/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/shiki/transformers/callouts.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/plugins/shiki/transformers/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/shared/constants.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/shared/helpers.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/shared/index.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/shared/types.d.ts' because it would overwrite input file.

error TS5055: Cannot write file '/Users/JounQin/Workspaces/GitHub/doom/packages/doom/lib/types.d.ts' because it would overwrite input file.


Found 24 errors.

🙂 Expected behavior

No error

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions