Skip to content

Conversation

@andreiborza
Copy link
Member

@andreiborzaandreiborza commented Dec 17, 2025

The newly released React Router 7.11.0 introduced vite preview support(remix-run/react-router#14507). This change has a bug that affects SPA mode (ssr: false).

When building in SPA mode, React Router correctly builds the server bundle (build/server/index.js) and then removes it with the message Removing the server build... due to ssr:false.

The new vite preview implementation doesn't account for this removal and attempts to import the deleted build/server/index.js file when starting the preview server, causing:

Cannot find module '/build/server/index.js'

Closes#18549 (added automatically)

The newly released [React Router 7.11.0](remix-run/react-router#14507) introduced vite preview support(remix-run/react-router#14507). This change has a bug that affects SPA mode (ssr: false). When building in SPA mode, React Router correctly builds the server bundle (build/server/index.js) and then removes it with the message "Removing the server build... due to ssr:false". The new vite preview implementation 7.11.0 doesn't account for this removal and attempts to import the deleted `build/server/index.js` file when starting the preview server, causing the `Cannot find module '/build/server/index.js'` issue.
Copy link
Member

@Lms24Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@andreiborzaandreiborza merged commit 97e0be0 into developDec 17, 2025
36 checks passed
@andreiborzaandreiborza deleted the ab/fix-e2e-rr-spa branch December 17, 2025 20:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(e2e): Pin to react-router 7.10.1 in spa e2e test

3 participants

@andreiborza@Lms24