Repository navigation
fix(server-functions): invalidate the dev manifest in every environment - #460
Merged
Merged
Conversation
A host that loads the generated server function handler from its own server environment (Void's void_worker, a Cloudflare worker) kept a stale manifest, because invalidation only reached the client and ssr environments. Server functions only the client referenced then 404'd until restart. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cu6PZEDjsyi1C2HmxYyimZ
🦋 Changeset detectedLatest commit: 84a681d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
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.
Requested by Ryan · project thread
What
invalidateModulesinsrc/server-functions/index.tsonly invalidated the server function manifest in theclientandssrenvironments. Now it loops over every environment on the dev server.Why
Some hosts import the generated handler (
virtual:solid-server-function-handler) from a server environment with their own name. Void (VoidZero/Cloudflare) usesvoid_worker, and@cloudflare/vite-pluginnames environments after workers. In those hosts the manifest module was never invalidated in dev. A"use server"function that only the client referenced (for example, one called from an event handler, which the SSR compile drops) was missing from the stale manifest. Calls failed with "Server function is not part of the deployment that answered" until the dev server restarted. A host with nossrenvironment would also have thrown here.I found this while testing Solid 2 rc.16, router next.41 and this plugin under Void's custom SSR. With this change, server functions work in dev there. The production build was already fine apart from the
$$moduleUrlentry export, which #423 fixes.This doesn't overlap #432. That PR removes the dev debounce and drops deleted modules, but it keeps the same two-environment invalidation. I checked: with #423 and #432 merged together, the Void case still fails until this change is added.
Tests
src/server-functions/environments.test.tsstarts a dev server with an extraworkerserver environment. It loads the manifest there, has the client transform a new"use server"module, and checks that the worker's manifest now includes it. It fails without the fix and passes with it.vitest run: 3 files, 23 tests pass.Generated by Claude Code