Skip to content

Base public path not working together with prerender anymore in v8 #15350

Description

@codler

Reproduction

https://stackblitz.com/edit/github-xzinw4xz?file=package.json

Set base: '/app/', in vite.config.ts and async prerender({ getStaticPaths }) { return getStaticPaths(); }, ssr: false, in react-router.config.ts

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 22.22.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @react-router/dev: ^8 => 8.3.0 
    @react-router/node: ^8 => 8.3.0 
    @react-router/serve: ^8 => 8.3.0 
    react-router: ^8 => 8.3.0 
    vite: ^8 => 8.1.5

Used Package Manager

npm

Expected Behavior

It should successfully build with no error as it did in v7.18.1

Actual Behavior

in react-router v8
Build error:

Error: Prerender: Request failed for /: SPA Mode: Received a 302 status code from entry.server.tsx while prerendering your SPA Fallback HTML file.

at defaultHandleError (file:///home/projects/github-xzinw4xz/node_modules/@react-router/dev/dist/vite.js:905:8)
at attempt (file:///home/projects/github-xzinw4xz/node_modules/@react-router/dev/dist/vite.js:853:11)
at async prerender (file:///home/projects/github-xzinw4xz/node_modules/@react-router/dev/dist/vite.js:860:64)
at async default.concurrency.concurrency (file:///home/projects/github-xzinw4xz/node_modules/@react-router/dev/dist/vite.js:877:9)
at async eval (file:///home/projects/github-xzinw4xz/node_modules/p-map/index.js:137:20)

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