#1413·tsup

dts build fails on TypeScript 6: baseUrl injected even when tsconfig declares none (TS5101 is now a hard error)

Author: svalloryCreated Sep 9, 2026Updated Sep 9, 2026

[!NOTE] This was verified by a human (me), both the description and the bug, but found and filed by claude

Bug

With [email protected] installed, any package using dts: true whose tsconfig does not declare baseUrl fails at the DTS step with TS5101.

Cause

tsup's bundled rollup-dts integration sets baseUrl unconditionally when building its virtual compiler host:

javascript
baseUrl: compilerOptions.baseUrl || "."

(observed in the published [email protected] bundle, dist/rollup.js, virtual compiler-host builder — around line 6837).

TypeScript 6.0 graduated the baseUrl deprecation (TS5101) from warning to hard error, so the injected "." fails the DTS compile even for projects that never configured baseUrl at all.

Note: rollup-plugin-dts itself declares peer support for typescript: "^4.5 || ^5 || ^6 || ^7" — the break comes from tsup's injection, not from the plugin's TS support surface.

Repro

  1. Package with tsup config dts: true, tsconfig without baseUrl.
  2. Install [email protected].
  3. Build → DTS step errors with TS5101.

Same package builds fine with [email protected].

Suggested fix

Only pass baseUrl to the DTS compiler host when the user's tsconfig actually defines it.

Environment

tsup 8.5.1 · typescript 6.0.3 · bun 1.3.11 · macOS