docs(playgrounds): prevent server-side execution of SSE query in Nuxt#1516
docs(playgrounds): prevent server-side execution of SSE query in Nuxt#1516dinwwwh merged 1 commit intomiddleapi:mainfrom
Conversation
📝 WalkthroughWalkthroughModified a Nuxt component to prevent server-side rendering issues by conditionally enabling Tanstack Query's Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the orpc-stream.vue component to ensure that the streamed options query and its rendered output are restricted to the client side. This is achieved by setting the enabled property to import.meta.client in the useQuery hook and wrapping the data display in a ClientOnly component. I have no feedback to provide as there were no review comments.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/client
@orpc/contract
@orpc/experimental-durable-iterator
@orpc/hey-api
@orpc/interop
@orpc/json-schema
@orpc/nest
@orpc/openapi
@orpc/openapi-client
@orpc/otel
@orpc/experimental-pino
@orpc/experimental-publisher
@orpc/experimental-publisher-durable-object
@orpc/experimental-ratelimit
@orpc/react
@orpc/react-query
@orpc/experimental-react-swr
@orpc/server
@orpc/shared
@orpc/solid-query
@orpc/standard-server
@orpc/standard-server-aws-lambda
@orpc/standard-server-fastify
@orpc/standard-server-fetch
@orpc/standard-server-node
@orpc/standard-server-peer
@orpc/svelte-query
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/vue-colada
@orpc/vue-query
@orpc/zod
commit: |
This PR fixes an issue in the Nuxt example that uses

useQuerywith oRPC's SSE (experimental_streamedOptions).Previously, the query would run during server-side rendering, leading to hydration errors because SSE requires a persistent client-side connection.
Summary by CodeRabbit