Skip to content

fix(server-functions): invalidate the dev manifest in every environment - #460

Merged
ryansolid merged 1 commit into
nextfrom
claude/project-thread-i4yj9d
Oct 21, 2026
Merged

ryansolid merged 1 commit into
nextfrom
claude/project-thread-i4yj9d

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Requested by Ryan · project thread

What

invalidateModules in src/server-functions/index.ts only invalidated the server function manifest in the client and ssr environments. 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) uses void_worker, and @cloudflare/vite-plugin names 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 no ssr environment 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 $$moduleUrl entry 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

  • New src/server-functions/environments.test.ts starts a dev server with an extra worker server 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

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-bot

changeset-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 84a681d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/vite-plugin Patch

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

@ryansolid ryansolid self-assigned this Oct 21, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/vite-plugin@460

commit: 84a681d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants