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
{{ message }}
Repository navigation
fix(config): explain the unrun fallback when unrun is not installed - #1129
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.
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI usage
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 saysFailed 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 installingunrunor 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-typesandunrunblocked from resolving.