Skip to content

[Bug?]: Official Nitro v3 static builds fail after prerendering and ignore Vite base in emitted asset URLs#2288

Description

@tanukihee

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 馃槸

With the official Nitro v3 Vite plugin and preset: "static", the build has two independent symptoms:

  1. Nitro writes .output/public/index.html, but SolidStart-generated asset URLs ignore base: "/foo/" and are root-absolute:

    <link href="/_build/assets/entry-client-....css" rel="stylesheet">
    <link href="/_build/assets/....js" rel="modulepreload">
    <script type="module" src="/_build/assets/entry-client-....js"></script>

    These are framework-generated stylesheet, modulepreload, and entry-script tags, not user-authored root-absolute URLs such as a favicon or anchor.

  2. The client build, SolidStart SSR service build, and Nitro prerendering succeed. The final Nitro environment build then exits nonzero:

    [start] [nitro] Building [Nitro] (preset: `static`, compatibility: `2026-08-11`)
    [success] [nitro] Generated public .output/public
    [info] [nitro] Initializing prerenderer
    [info] [nitro] Prerendered 1 routes in 0.243 seconds
    vite v8.2.1 building nitro environment for production...
    error during build:
    rolldownOptions.input should not be an html file when building for SSR. Please specify a dedicated SSR entry.
        at resolveRolldownOptions (.../node_modules/vite/dist/node/chunks/node.js:33605:73)
        at buildEnvironment (.../node_modules/vite/dist/node/chunks/node.js:33692:27)
        at Object.build (.../node_modules/vite/dist/node/chunks/node.js:34150:25)
        at buildEnvironments (.../node_modules/nitro/dist/vite.mjs:120:31)
    

The same build failure occurs when Vite is invoked directly through Node, so it is not Bun-specific.

Expected behavior 馃

  1. SolidStart-generated static asset tags should honor Vite base; with base: "/foo/", the generated URLs should begin with /foo/_build/....
  2. A static build using the official Nitro v3 Vite plugin should complete with exit code 0 after prerendering and produce deployable static output.

Steps to reproduce 馃暪

Steps:

  1. Create a current SolidStart v2 application with src/entry-client.tsx, src/entry-server.tsx, and at least one file route.

  2. Install these dependencies:

    npm install @solidjs/start@2.0.0 solid-js@1.9.14 @solidjs/router@1.0.0 @solidjs/meta@0.29.4 nitro@3.0.260610-beta vite@8.2.1
  3. Use this vite.config.ts:

    import { defineConfig } from "vite";
    import { nitro } from "nitro/vite";
    import { solidStart } from "@solidjs/start/config";
    
    export default defineConfig({
      plugins: [
        solidStart({ ssr: false }),
        nitro({
          preset: "static",
          baseURL: "/foo/",
        }),
      ],
      base: "/foo/",
    });
  4. Run:

    node ./node_modules/vite/bin/vite.js build
  5. Observe the root-absolute framework asset URLs in .output/public/index.html, followed by the Rolldown SSR-input error and nonzero exit status.

Scope checks from the same application:

Configuration Result
solidStart({ ssr: false }) without Nitro succeeds
solidStart({ ssr: false }) with nitro() and the default node-server preset succeeds
solidStart({ ssr: false }) with nitro({ preset: "static" }) fails with the SSR-input error
Same static configuration without base or baseURL fails with the same SSR-input error
solidStart() with SSR enabled and nitro({ preset: "static" }) fails with the same SSR-input error

The static-build failure is therefore independent of SPA mode and subpath configuration. I have not established whether its cause originates in SolidStart, Nitro, or the integration. I am reporting it here because it occurs with official SolidStart v2 plus nitro/vite, and a new modern-package report was requested in #2151.

Context 馃敠

I am deploying a static SolidStart application below a path prefix rather than the domain root. base: "/foo/" is required so framework-generated stylesheets and client modules resolve from the deployed location. The emitted root-absolute tags break asset loading under that prefix.

Separately, the final nonzero build exit prevents treating the generated static directory as a successful production artifact, even though prerendering has already completed.

The installed production manifest appears relevant to the first symptom because it currently produces asset paths with hard-coded root prefixes:

return join("/", viteManifestEntry.file);
output: join("/", viteManifest[entryKey].file);
href: "/" + asset;

PR #2152 appears to address that first symptom by using import.meta.env.BASE_URL.

Your environment 馃寧

System:
  OS: Linux 7.1.5-2-cachyos x86_64 GNU/Linux

Binaries:
  Node: v24.18.0
  npm: 11.16.0
  Bun: 1.3.14

npmPackages:
  @solidjs/meta: 0.29.4
  @solidjs/router: 1.0.0
  @solidjs/start: 2.0.0
  nitro: 3.0.260610-beta
  solid-js: 1.9.14
  vite: 8.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions