You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to generate DTS files for a specific module that depends on another module having it's types declared via module augmentation (declare module ...) results in an error.
However, TypeScript compiler is able to resolve augmented modules.
Version info
tsup 8.3.0
typescript 5.6.3
Repro
Create a new package called tsup-augmented-module via npm init and put inside index.d.ts module augmentation, e.g.:
> tsup
CLI Building entry: src/index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v8.3.0
CLI Using tsup config: /home/unional/code/repobuddy/sis/tsup.config.ts
CLI Target: chrome100,safari15,firefox91,node18
CLI Cleaning output folder
ESM Build start
Generated an empty chunk: "index".
ESM dist/index.js 68.00 B
ESM dist/index.js.map 69.00 B
ESM ⚡️ Build success in 19ms
DTS Build start
node_modules/rollup/dist/rollup.d.ts (9:0): "Decorator" is not exported by "node_modules/@types/estree/index.d.ts", imported by "node_modules/rollup/dist/rollup.d.ts".
Error: error occured in dts build
at Worker.<anonymous> (/home/unional/code/repobuddy/sis/node_modules/tsup/dist/index.js:1543:26)
at Worker.emit (node:events:514:28)
at MessagePort.<anonymous> (node:internal/worker:263:53)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:814:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28)
DTS Build error
Problem
declare module ...
) results in an error.Version info
Repro
tsup-augmented-module
vianpm init
and put insideindex.d.ts
module augmentation, e.g.:"types": "index.d.ts"
inpackage.json
.npm init
and put your augmented module as dependency:index.ts
write:npx tsup --entry index.ts --dts-only --dts-resolve
and see an error like:Expectation
As typescript complier is able to resolve augmented modules,
tsup
should be able to as well.Upvote & Fund
The text was updated successfully, but these errors were encountered: