bug: SSR mode has stopped working in built Next.js app
See original GitHub issueProvide environment information
System:
OS: Windows 10 10.0.22000
CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
Memory: 4.89 GB / 15.93 GB
Binaries:
Node: 19.2.0 - ~\scoop\apps\nodejs\current\node.EXE
npm: 8.19.3 - ~\scoop\apps\nodejs\current\npm.CMD
Browsers:
Edge: Spartan (44.22000.120.0), Chromium (107.0.1418.62)
Internet Explorer: 11.0.22000.120
npmPackages:
@tanstack/react-query: ^4.19.0 => 4.19.0
@trpc/client: ^10.4.3 => 10.4.3
@trpc/next: ^10.4.3 => 10.4.3
@trpc/react-query: ^10.4.3 => 10.4.3
@trpc/server: ^10.4.3 => 10.4.3
next: 13.0.6 => 13.0.6
react: 18.2.0 => 18.2.0
typescript: ^4.9.3 => 4.9.3
Describe the bug
With ssr: true
, Next.js and React Query renders the tRPC query with SSR prepass as expected in dev mode.
However, after building the app using npm run build
and then npm run start
, it doesn’t render the page with an SSR prepass. The initial load still shows the “Loading…” message / has no data.
refetchOnWindowFocus
works still, so the issue is with the initial SSR prepass on a built Next.js app.
Link to reproduction
https://github.com/austins/trpc-nextjs-ssr_not_working_in_build-repro
To reproduce
- Have
ssr: true
- Build Next.js app
- Run built Next.js app
- See that it doesn’t load the initial data via SSR prepass
Additional information
No response
👨👧👦 Contributing
- 🙋♂️ Yes, I’d be down to file a PR fixing this bug!
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
After updating to nextjs 12.0.1, next-middleware-ssr-loader ...
After updating to nextjs 12.0.1, next-middleware-ssr-loader gives an error saying _document not found. #30501.
Read more >react-hydration-error - Next.js
When css-in-js libraries are not set up for pre-rendering (SSR/SSG) it will often lead to a hydration mismatch. In general this means the...
Read more >Advanced Features: Debugging - Next.js
Using the Debugger in Jetbrains WebStorm Run this debug configuration, and the selected browser should automatically open. At this point, you should have...
Read more >Advanced Features: Custom Server - Next.js
Start a Next.js app programmatically using a custom server. ... If you have an existing backend, you can still use it with Next.js...
Read more >Advanced Features: Error Handling - Next.js
js application, you will encounter an overlay. It is a modal that covers the webpage. It is only visible when the development server...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My guess would be something changed within Next
Closing as this isn’t a tRPC issue, but an issue with Node.