Repository navigation
Hint at tsconfig path aliases when void.config.ts fails to load - #801
Merged
Merged
Conversation
voidzero-dev#800. Move the alias detection from the env.ts loader into a shared host helper, accept jiti's MODULE_NOT_FOUND code, and document that void.config.ts only supports relative imports and package names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #800.
void.config.tsis loaded with jiti, which only aliasesvoid/config, so an import through tsconfigpathsfailed with an error that reads like a missing package.env.tsalready detects this case and adds a hint; the config loader now does the same.Changes
extractFailedSpecifier()andlooksLikeAlias()fromhost/load-user-env.tsinto a newhost/alias-hint.ts, with analiasHint(err, file)helper that both loaders use.extractFailedSpecifier()now also acceptsMODULE_NOT_FOUND, the code jiti'srequire-based loading reports.loadVoidConfig()appends the hint when the failed specifier looks like an alias:docs/reference/config.mdnow says to use relative imports or package names invoid.config.ts, matching theenv.tsnote in the env vars guide.The
env.tshint wording changes slightly ("env.ts does not resolve tsconfig "paths"" instead of "env.ts is loaded directly by Node and does not resolve…") so both files share one message.Tests
packages/void/test/unit/config-loader.test.ts: a relative import loads, an@/…import gets the hint, and a missing scoped package (@scope/pkg) doesn't.vp test run(full suite: 793 files, 16674 tests passed) andvp run checkpass.🤖 Generated with Claude Code