Skip to content

vp pack --dts crashes with TypeScript 7 due to unavailable legacy Compiler API #2188

Description

@labbomb

Describe the bug

vp pack --dts crashes when the project uses typescript@7.0.2.

The declaration-generation code reads ts.sys.useCaseSensitiveFileNames, but the typescript package in TypeScript 7 does not expose the legacy Compiler API from its package root, so ts.sys is undefined.

@voidzero-dev/vite-plus-core@0.2.4 also currently declares the peer range typescript: "^5.0.0 || ^6.0.0".

Reproduction

Minimal files:

package.json

{
  "name": "vite-plus-ts7-repro",
  "private": true,
  "type": "module"
}

tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "bundler",
    "strict": true,
    "declaration": true
  },
  "include": ["src/**/*.ts"]
}

src/index.ts

export const answer = 42

Run:

pnpm --package vite-plus@0.2.4 \
  --package typescript@7.0.2 \
  --package esbuild@0.28.1 \
  dlx vp pack src/index.ts --dts

Steps to reproduce

  1. Create the three files above.
  2. Run the provided command.
  3. Observe that the JavaScript build begins, but declaration generation crashes.

Expected behavior

Vite+ should support declaration generation with TypeScript 7, or report a clear compatibility error instead of crashing while accessing the legacy Compiler API.

Actual behavior

WARN Issues with peer dependencies found
└─┬ vite-plus 0.2.4
  └─┬ @voidzero-dev/vite-plus-core 0.2.4
    └── ✕ unmet peer typescript@"^5.0.0 || ^6.0.0": found 7.0.2

[plugin rolldown-plugin-dts:generate]
TypeError: Cannot read properties of undefined (reading 'useCaseSensitiveFileNames')
    at @voidzero-dev/vite-plus-core/dist/tsdown/tsc-CdZE7QwS.js:60:31

The failing bundled code reads:

ts.sys.useCaseSensitiveFileNames

System Info

  • vite-plus: 0.2.4
  • TypeScript: 7.0.2
  • esbuild: 0.28.1
  • Node.js: 24.6.0
  • pnpm: 11.13.1
  • OS: macOS arm64

Additional context

TypeScript 7 type checking itself works in the project. The incompatibility is specifically triggered by Vite+'s declaration-generation path (vp pack --dts).

Validations

  • Read the Contributing Guidelines.
  • Checked that there isn't already an issue for the same bug.
  • Confirmed the failure occurs in a standalone Vite+ reproduction.
  • Reduced the reproduction to one TypeScript source file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions