From a289242cbb4faffcc554d5f638abee4d2f5c0297 Mon Sep 17 00:00:00 2001 From: tsushanth <78000697+tsushanth@users.noreply.github.com> Date: Tue, 23 Jun 2026 18:18:54 -0700 Subject: [PATCH 1/3] fix: move delete stream.then after dev-server branch to restore thenable --- packages/start/src/server/handler.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/start/src/server/handler.ts b/packages/start/src/server/handler.ts index 9b1c9f218..f08f1f41c 100644 --- a/packages/start/src/server/handler.ts +++ b/packages/start/src/server/handler.ts @@ -114,12 +114,15 @@ export function createBaseHandler( if (mode === "async") return await stream; - delete (stream as any).then; - // using TransformStream in dev can cause solid-start-dev-server to crash // when stream is cancelled if (globalThis.USING_SOLID_START_DEV_SERVER) return stream; + // remove thenable so h3/Cloudflare Workers do not await the stream object; + // must happen after the dev-server branch so the stream remains awaitable + // when returned to solid-start-dev-server above + delete (stream as any).then; + // returning stream directly breaks cloudflare workers const { writable, readable } = new TransformStream(); stream.pipeTo(writable); From 5d099753db3cf006af0118b5cd22c3c66904dc85 Mon Sep 17 00:00:00 2001 From: tsushanth <78000697+tsushanth@users.noreply.github.com> Date: Wed, 24 Jun 2026 17:02:07 -0700 Subject: [PATCH 2/3] fix: convert path to file URL before ESM import in preview server --- .changeset/fix-windows-preview-path-to-file-url.md | 5 +++++ packages/start/src/config/dev-server.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-windows-preview-path-to-file-url.md diff --git a/.changeset/fix-windows-preview-path-to-file-url.md b/.changeset/fix-windows-preview-path-to-file-url.md new file mode 100644 index 000000000..a007cc505 --- /dev/null +++ b/.changeset/fix-windows-preview-path-to-file-url.md @@ -0,0 +1,5 @@ +--- +"@solidjs/start": patch +--- + +Convert absolute path to file:// URL before dynamic import in preview server to fix Windows compatibility diff --git a/packages/start/src/config/dev-server.ts b/packages/start/src/config/dev-server.ts index d88a8cb0d..3b2ad6ae6 100644 --- a/packages/start/src/config/dev-server.ts +++ b/packages/start/src/config/dev-server.ts @@ -1,4 +1,5 @@ import { NodeRequest, sendNodeResponse } from "srvx/node"; +import { pathToFileURL } from "node:url"; import { type Connect, isRunnableDevEnvironment, @@ -18,7 +19,7 @@ export function devServer(): Array { const webReq = new NodeRequest({ req, res }); const def: { default: { fetch: (req: Request) => Promise }; - } = await import(process.cwd() + "/dist/server/entry-server.js"); + } = await import(pathToFileURL(process.cwd() + "/dist/server/entry-server.js").href); sendNodeResponse(res, await def.default.fetch(webReq)); }); }; From 7f63ec4d105c10871de085c1876cc26343e8848b Mon Sep 17 00:00:00 2001 From: tsushanth <78000697+tsushanth@users.noreply.github.com> Date: Wed, 24 Jun 2026 17:52:41 -0700 Subject: [PATCH 3/3] feat(config): add server-only and client-only virtual module plugin Adds a solid-start:boundary-modules Vite plugin to solidStart() that resolves the server-only and client-only bare specifiers at build time. Importing server-only in a client-environment module raises a Vite build error pointing at the importing file. Importing client-only in an SSR module does the same. In the correct environment both resolve to an empty module so they carry zero runtime overhead. This gives SolidStart the same build-time safety guarantee that Next.js provides through its own server-only/client-only packages, without requiring users to wire up the plugin themselves. Closes #2162 --- packages/start/src/config/index.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/start/src/config/index.ts b/packages/start/src/config/index.ts index 9cdc6830e..c0ae98d9f 100644 --- a/packages/start/src/config/index.ts +++ b/packages/start/src/config/index.ts @@ -200,6 +200,30 @@ export function solidStart(options?: SolidStartOptions): Array { }, filter: options?.serverFunctions?.filter, }), + { + name: "solid-start:boundary-modules", + resolveId(id, importer, { ssr }) { + if (id === "server-only") { + if (!ssr) { + this.error( + `[server-only] "${importer}" cannot import a server-only module on the client`, + ); + } + return "\0server-only"; + } + if (id === "client-only") { + if (ssr) { + this.error( + `[client-only] "${importer}" cannot import a client-only module on the server`, + ); + } + return "\0client-only"; + } + }, + load(id) { + if (id === "\0server-only" || id === "\0client-only") return "export {}"; + }, + }, { name: "solid-start:virtual-modules", async resolveId(id) {