egoist / egoist/tsup

--dts fails with typescript cli error

Open
#884 4 comments 12 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

When trying to compile the type definition files for my library using the `tsup --dts` command, I am seeing the error shown below.

```
error TS5074: Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified.

Error: error occured in dts build
at Worker. (D:\projects\express-packages\node_modules\tsup\dist\index.js:2281:26)
at Worker.emit (node:events:513:28)
at MessagePort. (node:internal/worker:233:53)
at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:694:20)
at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28)
DTS Build error
RollupError: Failed to compile. Check the logs above.
at error (D:\projects\express-packages\node_modules\rollup\dist\shared\rollup.js:274:30)
at Object.error (D:\projects\express-packages\node_modules\rollup\dist\shared\rollup.js:24694:20)
at Object.error (D:\projects\express-packages\node_modules\rollup\dist\shared\rollup.js:23888:42)
at generateDtsFromTs (D:\projects\express-packages\node_modules\tsup\dist\rollup.js:7498:22)
at D:\projects\express-packages\node_modules\tsup\dist\rollup.js:7505:59
at _nullishCoalesce (D:\projects\express-packages\node_modules\tsup\dist\rollup.js:1:198)
at Object.transform (D:\projects\express-packages\node_modules\tsup\dist\rollup.js:7505:18)
at D:\projects\express-packages\node_modules\rollup\dist\shared\rollup.js:24893:40
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the `tsup --dts` command with the reported TypeScript `--incremental` error, then trace the declaration-build path shown in the `tsup` and Rollup stack trace. Done means declaration generation no longer fails with TS5074 and the command completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.