Types issues upgrading to v11, `never` when using t.router
trpc-shared
.
```typescript...Trpc server actions
v11 incompatible with `@tanstack/react-query` > 5.59.9
Dynamically generate url for httpBatchLink
url
each time the component mounts.
I believe that I wouldn't even need a useEffect if I wasn't using Next, as I could directly grab these values from window.location
, but since I'm using SSR, this code doesn't make it through the SSR pass.
```TSX...onSuccess mutation not being called
onSuccess
callback I show a toast to the user telling them that the request was successful. However, when I do a state change before I call the mutation, eg setRequests
the onSuccess
callback never runs, I know this because the console log never appears. But, when I remove the setRequests
it does, there is no visible error in my console. Why does this happen? Is it by design?
```ts
export const GenerationsCard = ({ generation, selectedFlag, setRequests }: Props) => {
const clearMutation = api.generations.clear.useMutation();
const warnMutation = api.punishments.warn.useMutation();...Module "@trpc/server" has no exported member 'tracked'.
Re: relative imports to trpc.ts
type AppRouter = typeof appRouter
on the server side works as expected, regardless of relative / path alias import. But only upon client side import, the type isn't inferred properly anymore?...paths
within the child packages in monorepos is a bad idea :/
The server/user.router.ts will use the client/tsconfig.json#paths for module resolution during the import from client/index.ts (in contrast to imports from within server/)....Network tab returns array but data is undefined
data
property is undefinedKeep old data when changing trpc procedure inputs
navigate
triggers new inputs for the query.
```...AI support
How to get a TRPCClientError shape as in initTRPC errorFormatter for testing
Basic error handling patterns
Override output schema for certain mutations
How to handle TRPC error with tanstack/query in components
Migrating to v11 problem: 'reactQueryContext' does not exist in type 'CreateTRPCReactOptions
Object literal may only specify known properties, and 'reactQueryContext' does not exist in type 'CreateTRPCReactOptions<BuiltRouter<{ ctx: { req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypePro...'.
Object literal may only specify known properties, and 'reactQueryContext' does not exist in type 'CreateTRPCReactOptions<BuiltRouter<{ ctx: { req: fastify.FastifyRequest<fastify.RouteGenericInterface, fastify.RawServerDefault, IncomingMessage, fastify.FastifySchema, fastify.FastifyTypeProviderDefault, unknown, fastify.FastifyBaseLogger, fastify_types_type_provider.ResolveFastifyRequestType<fastify.FastifyTypePro...'.
Following documentation gives error: "You cannot dot into a client module from a server component."
21.6.2
, tRPC 11.0.0-rc.553
(client, server, next, react-query), next 14.2.14
, and react-query 5.59.0
So, I'm trying to follow the React-Query Server Components setup guide in the tRPC docs, and I've mostly just copy pasted the code out, yet my client component isn't working.
This works: ```tsx...'use-client'
rather than 'use client'
.automatically add current path to the useQuery
Error with AppRouter type mismatch in Deno