Repository navigation
fix(react): serve a workspace-linked void as source in dev - #720
Merged
cpojer merged 1 commit intoNov 5, 2026
Merged
Conversation
React Pages dev listed void/pages-client and void/pages-prefetch (and void/live/client for the worker) in optimizeDeps.include. For a linked void, as in this workspace, that makes Vite pre-bundle a copy of packages/void/dist into node_modules/.vite. Vite keys that cache by the lockfile and config, not by the linked files, so rebuilding void leaves the old copy in place. After voidzero-dev#715 added isVoidActionError to void/pages-client and re-exported it from @void/react, a cache built before voidzero-dev#715 broke every page: SyntaxError: The requested module '/node_modules/.vite/deps/void_pages-client.js?v=…' does not provide an export named 'isVoidActionError' The client entry never loads, so #app is never marked hydrated. The websockets playground suite timed out on /chat and /notifications locally while CI, which starts with no cache, passed. Include Void's own entries only when they resolve into node_modules. An installed void is still pre-bundled up front, which keeps the voidzero-dev#620 cold-start fix. A linked void is served as source, as Vite does for linked packages, so dev always uses the current build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cpojer
approved these changes
Nov 5, 2026
cpojer
left a comment
Member
There was a problem hiding this comment.
Thanks. I feel like all of this is a huge mess tbh and it keeps breaking. I don't know why this has to be so complex with Vite. There must be a much simpler way?
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.
What changed
Locally, React Pages apps in this repo could stop hydrating after
vp run build. The browser threw:The client entry never loaded, so
#appwas never marked hydrated.websockets-playground.test.tstimed out on/chatand/notifications(noted in #719). CI passed because it starts with no Vite cache.Cause
In dev, the React adapter listed
void/pages-clientandvoid/pages-prefetchin the clientoptimizeDeps.include(#620). It listedvoid/live/clientin the worker include. Herevoidis a linked workspace package. Vite serves a linked package as source unless it is listed ininclude, and a listed one is pre-bundled intonode_modules/.vite. That cache is keyed by the lockfile, config andNODE_ENV, not by the linked package's files, so rebuilding Void left the old copy in place.#715 added
isVoidActionErrortovoid/pages-clientand re-exported it from@void/react. Any cache written before #715 then broke the client.Fix
installedDependencies()keeps a Void entry inincludeonly when it resolves intonode_modules:voidinstallnode_modules)This only changes dev behavior for linked installs. Apps that install
voidfrom npm see no difference.For reviewers
@void/edge, which is linked too and has no imports. Serving them as source therefore can't trigger a late dependency discovery or a full reload.void/live/client: the worker include had the same stale-copy hazard, so the same rule applies there.import.meta.resolvefrom@void/react.voidis a peer dependency, so this finds the samevoidthe app uses.Verification
voidat feat(pages): export isVoidActionError() to recognize action errors at every status #715's parent and ran the websockets suite to fill the cache. Then I rebuilt on this branch and ran it again. Before this change: 2 failed. After: 3/3 passed on two runs.packages/react/test/unit/plugin-pages.test.ts: 34 passed. A new unit test covers installed paths (pnpm, npm, Windows) and a linked path. The dev-config test now checks that this workspace's linkedvoidis not pre-bundled.vp run check, lint and format are clean.vp test run: 774 of 777 files passed (1 skipped). The other 2 files were the Vue and Svelte*-pages-clientpreview suites. They reuse an existing playgrounddist, and this worktree's predated their newest fixtures. After deleting thosedistfolders, both passed (94 tests).To clear a stale cache without this change:
🤖 Generated with Claude Code