Unsafe assignment of an error typed value
Correct way to fetch trpc data on SSR and CSR
Client component does not receive updated data after refetch, how to resolve?
Can I respond to client from a middleware?
next()
as an output....Blob as response
Error handling abort on unstable_httpBatchStreamLink
nextjs middleware trpc authentication
new TRPCError({ code: 'UNAUTHORIZED' });
in the backend, how do I wrap that in nextjs middleware?
my nextjs middleware already reroutes to a 404 page if the requesting page is not found. how do I reroute to an authorized page for every server action with trpc?
in middleware.ts
it says that the request is getting captured at this location for some reason _nextjs_original-stack-frame
...Custom data transformer
LocalDate
, LocalTime
, Instant
, etc. from a date & time library. Every type can be serialized to a string (the corresponding ISO format) but it's unclear to me what the best strategy is via a data transformer?
Should I serialize these objects to a custom shape (e.g. { type: "LocalDate", value: "..." }
) so that it's trivial to deserialize? Seems kinda redundant since the type
information is already at the type level. Without a custom shape it's unclear to me how I would be able to deserialize the object given that I don't know the destination type....How to add req to Context?
ctx.req
and ctx.res
are always undefined. https://trpc.io/docs/server/context#inner-and-outer-context.
In this related issue, Julius stated that the code shouldn't even work. https://github.com/trpc/trpc/issues/5344.
What is the official consensus on this? If it doesn't work then how else does one add the request to context (and why is it in the docs)....Any guidance on adding middleware at the router level?
Sentry Profiling for TRPC
useQuery() integration is not passing `staleTime` to underlying query? (11.0.0-rc.593)
staleTime
on queries to something other than 0 to tell React Query that data loaded from storage is to be considered fresh. However, this doesn't work in practice if staleTime
is configured at the query level. I've managed to get persistence working correctly when configuring the query client's default options.
Is there an interaction that I'm not understanding here? Any advice would be welcome, thanks!...Getting CORS error with tRPC express adapter, locally
trpc version 11.0.0-rc.383 breaks turbo
How to use subscription with bullmq?
React app not inferring trpc client correctly
never
.
What exactly is happening here? I've added a few screenshots of my configs...Opinionated help: Where to place data access functions with respect to tRPC router(s)?
src/data-access/post/mutate-thing.ts
, and I am wanting to move them into a folder structure like this: src/server/routers/post/functions/mutate-thing.ts
but this feels a bit too nested (maybe not a bad thing) and for someone new to my codebase, this might make it difficult to find these functions.
My routers are all obviously defined at src/server/routers
, and I import my data access functions directly into each procedure within each router. Should I leave these data functions where they are at?...Types issues upgrading to v11, `never` when using t.router
trpc-shared
.
```typescript...Trpc server actions