Skip to content

fix(config): explain the unrun fallback when unrun is not installed - #1129

Merged
sxzz merged 2 commits into
rolldown:mainfrom
lazerg:fix/issue-1127-unrun-error
Nov 10, 2026
Merged

sxzz merged 2 commits into
rolldown:mainfrom
lazerg:fix/issue-1127-unrun-error

Conversation

@lazerg

@lazerg lazerg commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

AI usage

  • No AI was used in this PR.
  • AI was used:
    • I have carefully reviewed the AI-generated content myself.

Description

On a runtime without native TypeScript support (like Debian's Node.js build), the auto loader falls back to unrun, and when it isn't installed the error only says Failed to import module "unrun", which doesn't explain why it's needed. Now that case says the runtime can't run TypeScript natively and suggests installing unrun or using --config-loader tsx. Runtimes with native TypeScript support keep the old message.

Linked Issues

Fixes #1127

Additional context

Checked by running the CLI with --no-experimental-strip-types and unrun blocked from resolving.

@netlify

netlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit e88155a
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/6af2a7f0802c27f51dfbc9f3
😎 Deploy Preview https://deploy-preview-1129--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/rolldown/tsdown@1129 -D
npm i https://pkg.pr.new/rolldown/tsdown@1129 -D
yarn add https://pkg.pr.new/rolldown/tsdown@1129.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/rolldown/tsdown/create-tsdown@1129 -D
npm i https://pkg.pr.new/rolldown/tsdown/create-tsdown@1129 -D
yarn add https://pkg.pr.new/rolldown/tsdown/create-tsdown@1129.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1129 -D
npm i https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1129 -D
yarn add https://pkg.pr.new/rolldown/tsdown/@tsdown/css@1129.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1129 -D
npm i https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1129 -D
yarn add https://pkg.pr.new/rolldown/tsdown/@tsdown/exe@1129.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1129 -D
npm i https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1129 -D
yarn add https://pkg.pr.new/rolldown/tsdown/tsdown-migrate@1129.tgz -D

commit: e88155a

@sxzzbot

sxzzbot commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the fix! I pushed a follow-up commit (e88155a) on top of yours:

  • The new hint only shows when the auto loader falls back to unrun because the runtime has no native TypeScript support. When --config-loader unrun is set explicitly, or on Bun, the original "Please ensure it is installed." error is kept, since the hint wouldn't apply there.

  • Moved the loader resolution into createParser, so it knows whether the loader was picked automatically. resolveConfigLoader is gone, and createParser now returns { loader, parser }.

  • Reworded the message. unrun isn't strictly required, just the default, and the alternative shouldn't be limited to tsx:

    Failed to import module "unrun". The current runtime does not support TypeScript natively, so tsdown loads the config file with `unrun` by default. Please install `unrun`, or set the --config-loader CLI flag to another installed loader, such as `tsx`.

Verified with the built CLI, with unrun blocked from resolving:

Runtime --config-loader Result
--no-experimental-strip-types (auto) new hint
--no-experimental-strip-types unrun original error
native TS unrun original error

I also updated the PR title to match.

@sxzzbot sxzzbot changed the title fix(config): clarify missing unrun error without native TypeScript support fix(config): explain the unrun fallback when unrun is not installed Nov 10, 2026
@sxzz
sxzz enabled auto-merge (squash) November 10, 2026 05:14
@sxzz
sxzz merged commit 0a3ef56 into rolldown:main Nov 10, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message when unrun is required and missing

3 participants