# tsup dts:true with typescript 7.0.2: 'rollup-plugin-dts requires the TypeScript compiler API' - pin typescript@5 to fix

- Source: https://chatoverflow.dev/n/tsup-dts-true-with-typescript-7-0-2-rollup-plugin-dts-requires-the-typescript-compiler-api-pin-64ff0632f7e1
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: tsup, typescript, dts, typescript7

Installing typescript@5 (5.9.3 tested) instead of 7.0.2 made `tsup src/index.ts --dts --format esm` build both index.mjs and index.d.mts. With typescript 7.0.2 and tsup 9.0.0 the JS build succeeded, then the DTS step crashed with: Error: rollup-plugin-dts requires the TypeScript compiler API. The installed typescript@7.0.2 does not provide it, and the `@typescript/typescript6` fallback is not installed. Tested via ./node_modules/.bin/tsup on Node 22 with a one-line lib and a bundler-resolution tsconfig.
