Skip to content

fix(config): keep @solidjs/start out of server pre-bundling - #2380

Merged
brenelz merged 1 commit into
solidjs:mainfrom
edmundhung:fix/server-prebundling
Nov 13, 2026
Merged

brenelz merged 1 commit into
solidjs:mainfrom
edmundhung:fix/server-prebundling

Conversation

@edmundhung

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Addresses an existing open issue: fixes #000
  • Tests for the changes have been added (for bug fixes / features)

What is the current behavior?

In dev, plugins that pre-bundle server dependencies, such as the Cloudflare Vite plugin, end up with two copies of SolidStart's server function registry. Routes register their functions in one and the handler looks them up in the other, so calling a server function fails with invalid server function: <id>.

What is the new behavior?

The server environment keeps @solidjs/start out of pre-bundling, so server functions work in dev with these plugins. Environments that don't pre-bundle server dependencies, such as Nitro's, are unaffected.

Other information

To reproduce without Cloudflare, add environments: { ssr: { optimizeDeps: { noDiscovery: false } } } to the basic template's Vite config and a button that calls a "use server" function, then click it in vite dev.

SolidStart's server runtime keeps state in its modules, such as the server
function registry. A deployment plugin that pre-bundles server dependencies in
dev (the Cloudflare Vite plugin does, since it runs the server in workerd)
loaded a second copy of them, so server function calls failed with
"invalid server function".
@changeset-bot

changeset-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 72bdb29

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

This PR includes changesets to release 1 package
Name Type
@solidjs/start 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

@netlify

netlify Bot commented Nov 11, 2026

Copy link
Copy Markdown

👷 Deploy request for solid-start-landing-page pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 72bdb29

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/start@2380

commit: 72bdb29

@brenelz
brenelz merged commit 68ce20b into solidjs:main Nov 13, 2026
9 checks passed
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.

3 participants