TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize.
tsc
complaining about my root app router type being too large when using --declarations
. There was a ticket from 2022 about this, but it seems to have been closed as solved. There are some Zod tickets about this too, but unfortunately they don't provide solutions that are viable (e.g. disabling --declaration
is not viable for me.)
It seems like this is caused by having a large app router, where "large" means it has a bunch of endpoints, and the total combination of those endpoints' input
and output
validators (using Zod schemas) go above a certain threshold. I can solve it by strategically adding explicit types to some of the query/mutation handler function definitions, but it's a bit odd....useUtils changes at every render and causes useEffect to be called continuously
tRPC context, NeonDB & WebSockets
Can't access mutate utils by createTRPCQueryUtils
gzip responses
All my mutations are failing due to an empty body after upgrading to 11.0.0-rc.362
TRPCError: JSON Parse error: Unexpected EOF\n at new TRPCError (/mnt/c/Users/Ángel/IdeaProjects/back/node_modules/.pnpm/@trpc+server@11.0.0-rc.362/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/TRPCError.mjs:51:12)\n at <anonymous> (/mnt/c/Users/Ángel/IdeaProjects/back/node_modules/.pnpm/@trpc+server@11.0.0-rc.362/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/contentType.mjs:23:30)\n at processTicksAndRejections (:12:39)
I have tried debugging in http/contentType.mjs
and I found the request body is coming empty even if it shows a body on the browser devtools.
Originally happened after upgrading a lot of rc.xxx versions at once but I pinpointed it on rc.362. The mutation works fine on rc.361 even using rc.364 on the client....How to get data type from onMutate function in useMutation
data
parameter in the onMutate function.
```
api.task.createTask.useMutation({
onMutate: async (data) => {}})...How can I use multiple DBs with trpc in T3 app?
How does tRPC work?
How to disable Next.js draftmode in tRPC?
Handle Multipart form data.
Running Websockets/Subscriptions with Fetch / Edge Runtimes Adapter
TRPClientError: Unexpected character
Change db url in ctx with an API call
TRPC Docs Generation
error: NEXT_REDIRECT
Is there a way to use TRPC React Query Integration with Nanostores instead of the Context API?
What do you guys think about the approach of importing/exporting tRPC types to be used in separate B
Nx monorepo
but it turned out it's almost impossible to make it work with electron app that use electron-vite
.
After more research I found this repo: https://github.com/mkosir/trpc-api-boilerplate...How to add fallback link to tRPC link (Mirror API URL if main URL failed)
How can I show real-time post's replies/comments after a successful a reply mutation?