Duplicates
Latest version
Current behavior 😯
I’d appreciate the maintainers’ guidance on the preferred approach here. If the analysis and proposed direction below look correct,
I’d be happy to contribute a fix.
I am a member of the Vite+ team. I found this issue while investigating a bug reported here:
voidzero-dev/vite-plus#2416
The same behavior is reproducible with both Vite+ and official Vite:
The official Vite reproduction uses vite@8.2.0 and does not have either vite-plus or @voidzero-dev/vite-plus-core installed.
vite build succeeds and generates the Nitro server entry at:
Nitro records this entry in .output/nitro.json:
{
"serverEntry": "server/index.mjs",
"commands": {
"preview": "node ./server/index.mjs"
}
}
However, vite preview fails with the following error:
error when starting preview server:
Error: Could not find the SolidStart server entry in <project>/dist/server
The stack trace points to SolidStart's resolvePreviewServerEntry:
at resolvePreviewServerEntry (.../@solidjs/start/dist/config/dev-server.js:108:15)
at configurePreviewServer (.../@solidjs/start/dist/config/dev-server.js:20:54)
at preview (.../vite/dist/node/chunks/node.js:...)
SolidStart's resolvePreviewServerEntry only searches for:
dist/server/entry-server.js
dist/server/entry-server.mjs
Relevant implementation:
https://github.com/solidjs/solid-start/blob/main/packages/start/src/config/dev-server.ts
Both SolidStart and Nitro register a configurePreviewServer hook. The resolved hook order is:
solid-start-dev-server
nitro:preview
SolidStart's hook runs first and throws an error because dist/server/entry-server.* does not exist. This stops Vite's hook loop before reaching Nitro's preview hook.
I have shared the detailed investigation here:
voidzero-dev/vite-plus#2416 (comment)
Expected behavior 🤔
When Nitro's Vite plugin controls the production server, SolidStart's preview hook should not require its standalone dist/server/entry-server.* output.
Instead, vite preview should delegate preview handling to Nitro and serve the generated .output/server/index.mjs build.
Steps to reproduce 🕹
Reproduction using official Vite:
https://github.com/naokihaba/repro-vite-plus-2416-plain-vite
Steps:
-
Clone the reproduction:
git clone https://github.com/naokihaba/repro-vite-plus-2416-plain-vite.git
cd repro-vite-plus-2416-plain-vite
-
Install dependencies:
-
Build the application:
The build succeeds and generates .output/server/index.mjs.
-
Start the preview server:
Preview fails while looking for dist/server/entry-server.*.
The generated Nitro server works when started directly:
Context 🔦
This was initially reported as a Vite+ bug. I investigated it as a member of the Vite+ team and created a control reproduction using official vite@8.2.0.
Because the same failure occurs without Vite+, this appears to be an integration issue between SolidStart's preview hook and Nitro's preview handling.
SolidStart's configureServer hook already avoids taking control when another plugin manages the development server:
if ("dispatchFetch" in serverEnv) return;
// another plugin is controlling the dev server
if (!isRunnableDevEnvironment(serverEnv)) {
return;
}
I think configurePreviewServer needs equivalent delegation or skip behavior when Nitro controls preview.
The exact configureServer condition may not be directly reusable because the preview hook does not necessarily expose the same runtime environment. The important behavior is that SolidStart should avoid resolving dist/server/entry-server.* when another plugin, such as Nitro, owns the preview server.
Your environment 🌎
System:
OS: macOS 26.5.2
CPU: arm64
Binaries:
Node: 24.19.0
pnpm: 11.21.0
npmPackages:
@solidjs/start: 2.0.0
nitro: 3.0.260610-beta
solid-js: 1.9.14
vite: 8.2.0
Duplicates
Latest version
Current behavior 😯
I’d appreciate the maintainers’ guidance on the preferred approach here. If the analysis and proposed direction below look correct,
I’d be happy to contribute a fix.
I am a member of the Vite+ team. I found this issue while investigating a bug reported here:
voidzero-dev/vite-plus#2416
The same behavior is reproducible with both Vite+ and official Vite:
The official Vite reproduction uses
vite@8.2.0and does not have eithervite-plusor@voidzero-dev/vite-plus-coreinstalled.vite buildsucceeds and generates the Nitro server entry at:Nitro records this entry in
.output/nitro.json:{ "serverEntry": "server/index.mjs", "commands": { "preview": "node ./server/index.mjs" } }However,
vite previewfails with the following error:The stack trace points to SolidStart's
resolvePreviewServerEntry:SolidStart's
resolvePreviewServerEntryonly searches for:Relevant implementation:
https://github.com/solidjs/solid-start/blob/main/packages/start/src/config/dev-server.ts
Both SolidStart and Nitro register a
configurePreviewServerhook. The resolved hook order is:SolidStart's hook runs first and throws an error because
dist/server/entry-server.*does not exist. This stops Vite's hook loop before reaching Nitro's preview hook.I have shared the detailed investigation here:
voidzero-dev/vite-plus#2416 (comment)
Expected behavior 🤔
When Nitro's Vite plugin controls the production server, SolidStart's preview hook should not require its standalone
dist/server/entry-server.*output.Instead,
vite previewshould delegate preview handling to Nitro and serve the generated.output/server/index.mjsbuild.Steps to reproduce 🕹
Reproduction using official Vite:
https://github.com/naokihaba/repro-vite-plus-2416-plain-vite
Steps:
Clone the reproduction:
git clone https://github.com/naokihaba/repro-vite-plus-2416-plain-vite.git cd repro-vite-plus-2416-plain-viteInstall dependencies:
Build the application:
The build succeeds and generates
.output/server/index.mjs.Start the preview server:
Preview fails while looking for
dist/server/entry-server.*.The generated Nitro server works when started directly:
Context 🔦
This was initially reported as a Vite+ bug. I investigated it as a member of the Vite+ team and created a control reproduction using official
vite@8.2.0.Because the same failure occurs without Vite+, this appears to be an integration issue between SolidStart's preview hook and Nitro's preview handling.
SolidStart's
configureServerhook already avoids taking control when another plugin manages the development server:I think
configurePreviewServerneeds equivalent delegation or skip behavior when Nitro controls preview.The exact
configureServercondition may not be directly reusable because the preview hook does not necessarily expose the same runtime environment. The important behavior is that SolidStart should avoid resolvingdist/server/entry-server.*when another plugin, such as Nitro, owns the preview server.Your environment 🌎