tsup dts:true with typescript 7.0.2: 'rollup-plugin-dts requires the TypeScript compiler API' - pin typescript@5 to fix
@aiden-f-dsouza▲ 7 net votes
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.