Repository navigation
fix(config): stop pointing users at the legacy void.json - #716
Merged
cpojer merged 1 commit intoNov 4, 2026
Merged
Conversation
Projects configure Void through `void.config.ts`, but several places still named `void.json`, a file those projects don't have: - `sourceDir` errors from `readProjectPaths()`, which framework adapters and many CLI commands use (`readConfig()` already named the right file) - the error for source conventions that exist in both the project root and `sourceDir` - the `[cause]` line printed under every `void.config.ts` validation error, because `validateConfig()` kept the error from before it replaced the file name - `VoidAssetRewriteError` - `origin` labels in the dev `X-Void-Routing` header and routing lint warnings, which the rewrites guide already documents as `void.config.ts#routing.rewrites` - the file tree on the App Types docs page The `sourceDir` and conflict errors now name the project's actual config file, so projects that still use `void.json` keep seeing the right name. `validateConfig()` no longer attaches the original error as `cause`. `VoidAssetRewriteError` and the `origin` labels aren't given the file name, so they always say `void.config.ts`. `VoidAssetRewriteError` also linked to `void.dev`, which doesn't host the docs. It now links to `void.cloud`. Tests: cover the `sourceDir` and conflict errors for both config files, and what an invalid `void.config.ts` prints. The `void.config.ts` cases fail on `main`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8F8mb12HvQFWAKMEqYLme
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.
Projects configure Void through
void.config.ts, but several messages still namevoid.json, a file those projects don't have. For example, withsourceDir: 'src'androutes/in both the project root andsrc/,vp devstops with:The same file name appears in:
sourceDirerrors fromreadProjectPaths(), which framework adapters and many CLI commands use.readConfig()already named the right file.The
[cause]line printed under everyvoid.config.tsvalidation error, becausevalidateConfig()kept the error from before it replaced the file name:VoidAssetRewriteError.originlabels in the devX-Void-Routingheader and routing lint warnings.docs/guide/edge/rewrites.mdalready documents them asvoid.config.ts#routing.rewrites.The file tree on the App Types docs page.
VoidAssetRewriteErroralso links tovoid.dev, which answers any path with a page that redirects to/lander. The docs are onvoid.cloud.Fix
sourceDirand conflict errors name the project's actual config file, so projects that still usevoid.jsonkeep seeingvoid.json.validateConfig()no longer attaches the original error ascause. Its message only differs by the placeholder file name.VoidAssetRewriteErrornamesvoid.config.tsand links tovoid.cloud.originlabels readvoid.config.ts#routing.*.void.config.ts. The other docs already use it, so they do not change.Not changed here
VoidAssetRewriteErrorand theoriginlabels aren't given the file name, so projects that still usevoid.jsonseevoid.config.tsthere.void initandvoid deploymigrate those projects.playground/kitchen-sink/pages/auth.vuestill saysvoid.json.Tests
packages/void/test/unit/project-paths.test.ts: thesourceDirand conflict errors withvoid.config.ts, withvoid.jsonand with no config file.packages/void/test/unit/config.test.ts: what an invalidvoid.config.tsprints, throughutil.inspect, which is what adds the[cause]line.packages/void/test/unit/compile.test.ts: the file name and link inVoidAssetRewriteError.originexpectations in five unit test files move to the new label.These cases fail without this fix, except the
void.jsonones, which already passed.Verification
vp test run: 774 files pass, 1 skipped (15,966 tests pass, 29 skipped).vp run check: 33/33 pass.vp devon a copy ofplayground/ssr:/docs/xthrough arouting.rewritesrule answersX-Void-Routing: rewrite[/docs/*] -> /api/hello (void.config.ts#routing.rewrites)./oldthrough arouting.redirectsrule answersX-Void-Routing: redirect[/old] -> /api/hello 302 (void.config.ts#routing.redirects).c.rewrite('/hero.png')in middleware answers 500 and logsVoidAssetRewriteError, which namesvoid.config.tsand links tovoid.cloud.sourceDir, a badrouting.isrand a root conflict stop the server. Withvoid.config.ts, the output has novoid.jsonand no[cause]line. Withvoid.json, the errors namevoid.json.void prepareand a badrouting.isrinvoid.config.ts: the error namesvoid.config.ts, and the output has novoid.json.vp run --filter ./docs build: the App Types page listsvoid.config.ts, andvoid.jsonis gone from it.routing.fallbacksrule. The app's SSR entry answered first, and the unit tests check that label.