-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
React SSR not working in Production Build. #8449
Comments
|
maybe yes, but this dosn't work. It builds but change nothing. |
I had to choose the 3.0.0-alpha.9 version to get the i understand why it is there, as it mentioned in the docs there: https://vitejs.dev/guide/ssr.html#setting-up-the-dev-server "Instead of await vite.ssrLoadModule('/src/entry-server.js'), use require('./dist/server/entry-server.js') instead (this file is the result of the SSR build)" but this seems not suitable for streaming. |
What do you mean by "not suitable for streaming"? |
Because i use the ssr over streaming in react 18 and when i cant use loadssrmodule in the preview server it might be not working. I tried it shortly but only with require as it mentioned in the docu, i cant get it working. So maybe i need to setup an extra node express server for that. I m correct? |
Streaming works with |
When i try that i got errors like no loader for .svg is configured and when i comment that out |
I'll close this as it doesn't seem to be a bug in Vite, but more of a usage issue. Re |
Describe the bug
I managed to get SSR with React and Vite working with the command "vite" but when i try to build with "vite build" and serve it with "vite preview" SSR got not working.
The code is Public and i want to Maintain it as a good template: https://github.com/Trackhe/Vite-React-SSR-HMR
Reproduction
Reproduction clone my code, then
npm i
->npm run dev
try all works. shutdown and trynpm run preview
, look in the loaded document now no SSRSystem Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: