Skip to content

fix(prerender): use Vite base as default basename - #15379

Open
wanxiankai wants to merge 2 commits into
remix-run:mainfrom
wanxiankai:fix/prerender-vite-base
Open

fix(prerender): use Vite base as default basename#15379
wanxiankai wants to merge 2 commits into
remix-run:mainfrom
wanxiankai:fix/prerender-vite-base

Conversation

@wanxiankai

Copy link
Copy Markdown

Closes #15350

What changed

  • Use a local absolute Vite base as the production basename when the React Router basename is left at its default.
  • Preserve explicit basenames as well as relative, external, and protocol-relative Vite base URLs.
  • Add a regression test covering SPA prerender output under /app/.

Why

In v8, the prerender preview server is served under the Vite base path, but build-time requests were still created from the default React Router basename (/). This caused requests such as /_.data to return 404 instead of being handled under /app/.

Testing

  • pnpm test:integration:run integration/vite-prerender-test.ts --project chromium -g "Prerenders a spa fallback" (2 passed)
  • pnpm run typecheck
  • pnpm run lint (0 errors)
  • pnpm run format:check
  • pnpm build

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Base public path not working together with prerender anymore in v8

2 participants