Skip to content

fix: support relocated client-mode build outputs - #404

Merged
ryansolid merged 1 commit into
nextfrom
fix/client-host-prerender
Oct 8, 2026
Merged

ryansolid merged 1 commit into
nextfrom
fix/client-host-prerender

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Summary

Revives #386 (closed by the author with no explanation) against current next, including the Solid 2.0.0-rc.14 bump. This is the same behavior, reconciled with #383 rather than a blind cherry-pick.

  • Client-mode prerender imports server.js from the SSR environment’s resolved/emitted directory and writes index.html into the client emit directory. A non-OK handler response still fails the build before that write, so a failed shell does not become index.html.
  • Preview resolves those same directories. Unless start.external is set, preview may still default them to dist/client and dist/server; a host that relocates in configEnvironment wins.
  • A non-pre buildApp on another plugin, or a user builder.buildApp, keeps the SSR service even when serverFunctions is off. Standalone client builds still delete it, and only when that directory is strictly inside the project root and is not an ancestor of the client output. Otherwise the plugin warns with the [@solidjs/vite-plugin] prefix and leaves the directory in place.

Fixes #381.

Test plan

  • examples/start-client test script (node test/run.mjs && node test/host-build.mjs) on Solid 2.0.0-rc.14: 70/70 existing assertions, plus relocated host/preview builds (configEnvironment, including configured out dirs), unsafe cleanup targets, and failure-path sandbox cleanup
  • CI on this PR

Made with Cursor

Revive #386. Client-mode prerender and preview follow the resolved client
and server directories, still refuse to write a non-OK shell as index.html,
and keep the SSR service for host orchestrators. Standalone builds still
drop that service only when it sits strictly inside the project root and
does not contain client output.

Fixes #381.

Co-authored-by: Éverton Toffanetto <evertondgn@hotmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9f5b744

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 9f5b744

@ryansolid
ryansolid merged commit 5c9d716 into next Oct 8, 2026
6 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.

1 participant