#1389·tsup

Support TypeScript 6

Author: HannesOberreiterCreated Mar 24, 2026Updated May 26, 2026

When using tsup with TypeScript 6.x (typescript@^6.0.0), the DTS build fails with two issues:

1. Deprecated baseUrl option

error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0.
Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

Possible cause: In getRollupConfig, baseUrl is explicitly set with a fallback:

javascript
baseUrl: compilerOptions.baseUrl || ".",

2. Node types not resolved

error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node?
Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.

Possible cause: The compiler options merge:

javascript
if (options.dts) {
  options.dts.compilerOptions = {
    ...tsconfig.data.compilerOptions || {},
    ...options.dts.compilerOptions || {}
  };
}

Workaround

json
{
  "compilerOptions": {
    "ignoreDeprecations": "6.0",
    "types": ["node"]
  }
}

Environment

  • tsup: 8.x
  • typescript: 6.x
  • @types/node: 22.x
  • Node.js: 22.x