-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
ssr: false
: build script creates a server bundle and deletes it
#12641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment has been minimized.
This comment has been minimized.
Im facing something similar with rxjs and ant design where the SSR build (sometimes in dev mode too) cannot find some modules [vite] Internal server error: Cannot find module '/Users/pfe/WebstormProjects/rtr-admin/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected]/node_modules/rc-util/es/omit' imported from /Users/pfe/WebstormProjects/rtr-admin/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected]/node_modules/antd/es/layout/layout.js And i not using ssr at all, just spa mode (ssr:false) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Same issue here but even worse. I changed the "buildDirectory" in react-router.config.js to be a parent folder (wwwroot). When building for production, SPA assets are generated under wwwroot/client. Then it starts the server build (event with ssr: false), but this time it ends in error : |
I encountered the same issue when working with styled components. They require special configuration to work with SSR. Because react-router tries to create a server build even when |
Hey @TimurTimergalin I was able to get |
Thank you, @jmho, I appreciate your effort. Seems odd indeed. I also asked about this on StackOverflow and the proposed solution worked for me - for anyone who comes across the same issue. |
We're working to improve the docs around the nuances here, but the important thing to note is that This is why we still generate a server build, which is deleted upon successful I'm going to close this out since the original question is expected behavior and without a reproduction I don't think there's much more to do to triage. If there are specific libraries you are having trouble using in SPA mode, please open a new issue with a minimal reproduction (https://reactrouter.com/new) that we can look into. |
Thanks for the update @brophdawg11 A parameter like Love you all 💚💚💚. |
That was a bug and is fixed by #12948 - that will be release in a |
Honestly, I am somewhat new to the full-stack framework. I have always worked with single-page applications using React and Vue. In fact, I almost considered deleting the comment because it seemed like an unreasonable request. Thank you and team. |
I'm using React Router as a...
framework
Reproduction
Prior to v7, we used v6 and component routes. After upgrading to v7 as a framework and setting
ssr: false
, we faced some problems including:@mui/icons-material
imports started to fail. So we added this tovite.config.ts
:@mui/utils
(this is used in@mui
packages' internals).We currently have solved this issue by using the current
vite.config.ts
:ErrorBoundary
when facing 404 error. It complains about the unavailability of browser globals such as local storage. I had assumed that upgrading to v7 and using the SPA mode would be seamless. I have set SSR to false and yet I am facing problems here and there regarding SSR in the prod and dev environments.System Info
Used Package Manager
pnpm
Expected Behavior
Having a complete client-side router that gives us the option of using file-based routing, in case
ssr: false
.Actual Behavior
Server bundle generation during build, and import resolution errors that didn't exist with v6.
The text was updated successfully, but these errors were encountered: