Skip to content

[Bug]: vp preview fails on SolidStart v2 — looks for dist/server but build is in .output/server #2416

Closed

Description

@Nicktriez

Describe the bug

vp preview fails on a SolidStart v2 project. vp build succeeds, but vp preview throws:

error when starting preview server:
Error: Could not find the SolidStart server entry in <project>/dist/server
    at resolvePreviewServerEntry (file:///.../@solidjs/start/dist/config/dev-server.js:108:15)
    at configurePreviewServer (.../dev-server.js:20:54)

The build output lands in .output/server (Nitro's standard layout — the build log shows nitro ... preset: node-server writing .output/server/index.mjs), but SolidStart 2's configurePreviewServer hook hardcodes dist/server as the server-entry location. So preview looks in the wrong directory.

This is distinct from #1291 (SolidStart v1 / Vinxi dev-server support, closed). SolidStart v2 uses native Vite (no Vinxi), so the preview hook resolution is the remaining mismatch.

Steps to reproduce

  1. Scaffold a SolidStart v2 project with the Tailwind template:
    pnpm create solid@latest
    # select: SolidStart, TypeScript, with-tailwindcss
  2. Add the Vite+ toolchain:
    vp migrate
  3. Build:
    vp build
    # succeeds — output written to .output/server and .output/public
  4. Preview:
    vp preview
    # fails: "Could not find the SolidStart server entry in .../dist/server"

Expected behavior

vp preview should serve the production build — either by finding the server entry at .output/server (where Vite+/Nitro actually wrote it), or by delegating preview to Nitro's server for frameworks that use Nitro.

Actual behavior

vp preview errors out looking for dist/server, which never exists in a Vite+/Nitro build.

Environment

  • Vite+ / vp via vp migrate (vite-plus core 0.2.8)
  • SolidStart 2 (@solidjs/start@^2.0.0, vite@^8, nitro@^3 beta)
  • OS: Ubuntu 24.04 / Pop!_OS
  • Node 24

Workaround

node .output/server/index.mjs (the start script) runs the production server correctly. The only broken piece is vp preview.

Related

Activity

  1. fengmk2 commented on Aug 11, 2026

    @fengmk2
    Member
  2. naokihaba commented on Aug 11, 2026

    @naokihaba
    Collaborator

    @fengmk2
    I'll take care of this.

  3. self-assigned this
    on Aug 11, 2026
  4. naokihaba commented on Aug 14, 2026

    @naokihaba
    Collaborator

    @Nicktriez cc @fengmk2

    Thank you for the report.

    I was able to reproduce the same behavior even after removing both vite-plus and @voidzero-dev/vite-plus-core and using only official vite@8.2.0.

    Looking at the stack trace, it points to resolvePreviewServerEntry in SolidStart.

    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:...)
    

    The relevant SolidStart implementation is here.
    https://github.com/solidjs/solid-start/blob/main/packages/start/src/config/dev-server.ts

    On the other hand, the Nitro build itself succeeds, and .output/nitro.json outputs the following:

    {
      "serverEntry": "server/index.mjs",
      "commands": {
        "preview": "node ./server/index.mjs"
      }
    }

    In other words, the actual server entry generated by Nitro is .output/server/index.mjs.

    However, resolvePreviewServerEntry in SolidStart only searches for the following two files:

    • dist/server/entry-server.js
    • dist/server/entry-server.mjs

    I also checked the execution order of the configurePreviewServer hook, and it was in the following order:

    1. solid-start-dev-server
    2. nitro:preview

    The SolidStart hook runs first, but since the dist/server/entry-server.* it is looking for cannot be found, an error occurs. As a result, Vite's hook loop stops before processing can reach the subsequent nitro:preview.

    Note that SolidStart's configureServer hook (for the dev server) already has a mechanism to skip processing if another plugin is managing the server.

    if ("dispatchFetch" in serverEnv) return;
    
    // another plugin is controlling the dev server
    if (!isRunnableDevEnvironment(serverEnv)) {
      return;
    }

    However, it seems that configurePreviewServer hook, which is causing the issue this time, does not include such a skip mechanism.

    The test code for the relevant logic can be found here:
    https://github.com/solidjs/solid-start/blob/main/packages/start/src/config/dev-server.spec.ts

    Based on the above, I believe this is not an issue specific to Vite+, but rather a bug in the integration between SolidStart's preview hook and Nitro's preview processing.

    Therefore, I will report this issue to the upstream repository solidjs/solid-start and share the link to the created issue here later.

  5. added theissue type on Aug 14, 2026
  6. naokihaba commented on Aug 14, 2026

    @naokihaba
    Collaborator

    We will provide further updates on this matter at the following link:
    solidjs/solid-start#2291

    This issue will remain open for reference in case similar problems occur until it is fully resolved.

  7. added this to the RC milestone on Aug 15, 2026
  8. naokihaba commented on Aug 16, 2026

    @naokihaba
    Collaborator

    This issue seems to be related to nitrojs/nitro#4509.

    I’ve closed solidjs/solid-start#2291 for now and will keep an eye on the Nitro PR. Once the fix is merged and released, I’ll check if it also resolves the VP preview failure reported here.

    If the issue persists, I’ll reopen the SolidStart issue and look into it further.

  9. naokihaba commented on Aug 18, 2026

    @naokihaba
    Collaborator

    A patch was applied in solidjs/solid-start#2294.

  10. birkskyum commented on Aug 18, 2026

    @birkskyum

    Likely to be resolved by newly published @solidjs/start 2.0.1 - let me know how it fares.

  11. naokihaba commented on Aug 18, 2026

    @naokihaba
    Collaborator

    @birkskyum Thank you! I will check it.

  12. naokihaba commented on Aug 18, 2026

    @naokihaba
    Collaborator

    @birkskyum I confirmed that upgrading solidjs/start to 2.0.1 resolves the issue.

    Thank you very much.

    https://github.com/naokihaba/repro-vite-plus-2416

    ❯ vp build
    VITE+ - The Unified Toolchain for the Web
    
    note: You are running `vp build` as a Vite+ built-in command. If you meant to run the build npm script, use `vpr build` instead.
    ✓ 90 modules transformed.
    computing gzip size...
    .output/public/.vite/manifest.json                       1.92 kB │ gzip:  0.41 kB
    .output/public/_build/assets/entry-client-rqs_ywYT.css  16.71 kB │ gzip:  4.11 kB
    .output/public/_build/assets/Counter-BHAS_yVj.js         0.43 kB │ gzip:  0.31 kB
    .output/public/_build/assets/about-D5YFL7jt.js           0.80 kB │ gzip:  0.49 kB
    .output/public/_build/assets/_...404_-hpLUZLl_.js        0.81 kB │ gzip:  0.47 kB
    .output/public/_build/assets/components-DaTHawVt.js      0.83 kB │ gzip:  0.50 kB
    .output/public/_build/assets/index-BBXY44ug.js           0.84 kB │ gzip:  0.50 kB
    .output/public/_build/assets/entry-client-C3k1i2R9.js   15.37 kB │ gzip:  6.01 kB
    .output/public/_build/assets/routing-BjKLvV_s.js        32.60 kB │ gzip: 12.67 kB
    
    ✓ built in 580ms
    ✓ 120 modules transformed.
    computing gzip size...
    node_modules/.nitro/vite/services/ssr/.vite/manifest.json                     1.63 kB │ gzip:  0.39 kB
    node_modules/.nitro/vite/services/ssr/_build/assets/index-rqs_ywYT.css       16.71 kB │ gzip:  4.11 kB
    node_modules/.nitro/vite/services/ssr/_build/assets/Counter-sAE63GhN.js       0.50 kB │ gzip:  0.33 kB
    node_modules/.nitro/vite/services/ssr/_build/assets/about-DwjwfZq_.js         0.99 kB │ gzip:  0.55 kB
    node_modules/.nitro/vite/services/ssr/_build/assets/index-qXL0X6EZ.js         1.00 kB │ gzip:  0.56 kB
    node_modules/.nitro/vite/services/ssr/_build/assets/_...404_-CAcNGK8z.js      1.01 kB │ gzip:  0.54 kB
    node_modules/.nitro/vite/services/ssr/_build/assets/components-COZ-Zkdp.js    1.56 kB │ gzip:  0.73 kB
    node_modules/.nitro/vite/services/ssr/index.js                              210.93 kB │ gzip: 51.36 kB
    
    ✓ built in 1.09s
    
    ◐ Building [Nitro] (preset: node-server, compatibility: 2026-08-18)                                             nitro 9:04:19 PM
    ✔ Generated public .output/public                                                                              nitro 9:04:19 PM
    ✓ 64 modules transformed.
    computing gzip size...
    .output/server/_ssr/Counter-sAE63GhN.mjs       0.55 kB │ gzip:  0.38 kB
    .output/server/_ssr/about-DwjwfZq_.mjs         1.04 kB │ gzip:  0.60 kB
    .output/server/_ssr/index-qXL0X6EZ.mjs         1.05 kB │ gzip:  0.61 kB
    .output/server/_...404_-CAcNGK8z.mjs           1.06 kB │ gzip:  0.59 kB
    .output/server/_chunks/ssr-renderer.mjs        1.11 kB │ gzip:  0.54 kB
    .output/server/_ssr/components-COZ-Zkdp.mjs    1.50 kB │ gzip:  0.72 kB
    .output/server/_libs/ufo.mjs                   2.21 kB │ gzip:  0.72 kB
    .output/server/_libs/seroval-plugins.mjs      12.23 kB │ gzip:  2.40 kB
    .output/server/index.mjs                      12.54 kB │ gzip:  4.02 kB
    .output/server/_libs/solid-js.mjs             28.68 kB │ gzip:  8.27 kB
    .output/server/_libs/seroval.mjs              34.32 kB │ gzip:  9.65 kB
    .output/server/_libs/h3+rou3+srvx.mjs         46.29 kB │ gzip: 12.41 kB
    .output/server/_ssr/ssr.mjs                  193.26 kB │ gzip: 46.82 kB
    
    ✓ built in 237ms
    ℹ Generated .output/nitro.json                                                                                       9:04:19 PM
    
    ✔ You can preview this build using npx vite preview                                                            nitro 9:04:19 PM
    
    󰀵 naokihaba …/repro-vite-plus-2416   main   v24.18.1   21:04:19   in 2s730ms
    ❯ vp preview
    
    VITE+ - The Unified Toolchain for the Web
    
    note: You are running `vp preview` as a Vite+ built-in command. If you meant to run the preview npm script, use `vpr preview` instead.
    
     ╭────────── [Build Info] ────────────╮
     │                                    │
     │  - Build Directory: .output        │
     │  - Date: 8/18/2026, 9:04:19 PM     │
     │  - Nitro Version: 3.0.260610-beta  │
     │  - Nitro Preset: node-server       │
     │                                    │
     ╰────────────────────────────────────╯
    
      ➜  Local:   http://localhost:3000/
      ➜  Network: use --host to expose
      ➜  press h + enter to show help
  13. naokihaba commented on Aug 18, 2026

    @naokihaba
    Collaborator

    @Nicktriez Could you please check if the issue is fixed on your side when you get a chance?

  14. Nicktriez commented on Aug 18, 2026

    @Nicktriez
    Author

    @naokihaba preview works now. Good work.

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

Metadata

Metadata

Assignees

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions