Conversation
The server-function handler imports a server page's file whole, so the ?pick=default copy was a second instance that registered the page's server function twice. Fixes #16.
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.
Fixes #16.
With
serverComponents: true, the SSR environment loaded each server page twice. The manifest imported it as?pick=default, and@solidjs/vite-plugin's server-function handler imported the plain file. Both instances calledregisterServerReferencewith the same id, and the second call replaced the first. The GET grant that@solidjs/router'squery()makes was bound to the replaced function, so every client-side call to a server page returned 405.In server-consumer environments, the Vite adapter now uses the plain id for every ref to a server page's file (
$component,$$route, and any handler refs), in both the virtual module and the build inputs. The handler already loads that file whole, so a picked copy only added a second instance. Client environments still pick, so client bundles keep the stub and code splitting.Verification:
pnpm testpasses (114 tests). The new test intest/vite.spec.tschecks that thessrmanifest imports the server page without?pick=, and it fails without the change.dist, with the local?pick=workaround plugin removed.vite buildnow emits oneregisterServerReferenceper server page id instead of two. A Playwright run against the production server andvitedev navigated client-side to the server pages and submitted the form, and every/_server/data/...call returned 200. The same run against published 0.4.0 gets stuck on the first client navigation.The third fix suggested in the issue, making a duplicate
registerServerReferencewarn in@solidjs/web, is out of scope here.🤖 Generated with Claude Code