Repository navigation
Build fails on fresh clone: tsdown cannot load tsdown.config.ts because "unrun" is not installed #623
Replies: 4 comments
|
Confirmed β and there is a second defect hiding behind this one. Adding β¦even though Root causetsdown 0.22.2 picks its config loader automatically: native loader when the runtime has compiled-in TypeScript support, otherwise
Fix (verified)Two small changes; build goes green on an apt-packaged Node 22.22.1 with the full host + client faces:
const REPOSITORY_ROOT = findRepositoryRoot()
function findRepositoryRoot(): string {
for (let dir = process.cwd(); ; dir = dirname(dir)) {
if (existsSync(resolvePath(dir, 'pnpm-workspace.yaml'))) return dir
if (dirname(dir) === dir) {
throw new Error('tsdown.client: no pnpm-workspace.yaml above the working directory marks the repository root')
}
}
}Working branch with both changes (plus a bilingual Agent Note documenting the decision): |
Additional confirmation on Node.js 22.22.1Confirmed independently on Linux with Node.js The system-provided Node.js binary satisfies the repository's declared After a successful dependency installation, Using Node.js This provides another reproduction showing that the Node.js version check alone does not guarantee native TypeScript support. |
|
η¨nodejs ζζ°ηε°±ε―δ»₯δΊ |
|
I'm experiencing the same issue on node =<22. I have no problem on a v24 version of node however. |
Uh oh!
There was an error while loading. Please reload this page.
Description
Following the README's from-source setup:
pnpm run buildfails at the tsdown step with:Root cause
tsdown 0.22.2 loads
tsdown.config.tsthrough a config loader. With the default--config-loader auto, on a runtime without native TS support it resolves to theunrunloader:unrunis declared by tsdown as an optional peerDependency ("unrun": "*"), so pnpm does not install it automatically. The repository's rootdevDependenciesincludes tsdown's other optional peers (tsx,publint, ...) but is missingunrunβ so a fresh clone cannot build.Steps to reproduce
git clone https://github.com/deepseek-ai/deepseek-harness.gitcd deepseek-harnesspnpm install(pnpm@11.7.0, matchespackageManager)pnpm run buildβ fails in tsdownEnvironment
engines: ^22.19.0 || >=24.0.0)Suggested fix
Add
"unrun"to the rootdevDependencies(e.g."unrun": "^0.3.1"), alongside the other tsdown optional peers already present.Workaround
Set
NODE_OPTIONS=--experimental-strip-typesso tsdown falls back to its native loader, or upgrade Node to>= 22.18where native TS support is enabled by default.All reactions