Open
Description
Area of Improvement
In the new tRPC integration with React Query, there is no mention of disabling error redaction in Server Components when using Next.js. It could be helpful to include a small info card stating that if you are using Next.js, you should add something along the lines of the following:
new QueryClient({
defaultOptions: {
...
dehydrate: {
...
shouldRedactErrors: (error) => {
// We should not catch Next.js server errors
// as that's how Next.js detects dynamic pages
// so we cannot redact them.
// Next.js also automatically redacts errors for us
// with better digests.
return false;
},
},
},
});
Link to related docs
https://trpc.io/docs/client/tanstack-react-query/server-components#3-create-a-query-client-factory
Additional information
If it's not disabled, then Next.js doesn't recognize it's a dynamic page, and will throw an error during build.
👨👧👦 Contributing
- 🙋♂️ Yes, I'd be down to file a PR implementing the suggested changes!