errorFormatter ignored when using appRouter.createCaller
My errorFormatter works correctly in the actual application using an adapter, e.g.
But in my tests where I just use
createCaller
, the errorFormatter is never called.
I created a quick sandbox to show this behavior:
https://stackblitz.com/edit/trpc-server-inferred-type-cannot-be-named-x2pseq?file=src/index.ts
When calling getFoo()
I am expecting the errorFormatter to be called and transform the error to { message: 'Huge error' }
, but when using the appRouter.createCaller()
, the errorFormatter
is never called.
Any idea what I am missing?N
Nickβ’411d ago
Could you open a GitHub issue for this? It might be intentional but I agree itβs illogical as a user
Since you have a reproduction case already we can investigate π
S
seN49β’411d ago
GitHub
bug: errorFormatter ignored when using appRouter.createCaller Β· Iss...
Provide environment information System: OS: macOS 13.2.1 CPU: (10) arm64 Apple M1 Pro Memory: 3.36 GB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/...
4.8KMembers
View on DiscordMore Posts
Is there a way to define the Websocket protocol when using wsLink()I am attempting to use tRPC with Azure's Pub/Sub Websockets service it appears to require custom proThe inferred type of this node exceeds the maximum length the compiler will serialize.Hey, there I am running into this error when I have more than 12 routers in the mergeRouters functioQuickstart not workingHello there,
There is a type error in the quickstart example if i'm not mistaken.
I pretty much coUse TRPC function inside of a TRPC functionHi all! We have a trpc query called getProduct. I want to use this getProduct query inside of anotheSupabase with trpcWhen trying to configure trpc with supabase, getting this kind of error in the console
`tRPC failed Using tRPC for uploading audio filesI want to create an api router in tRPC but am not sure if the following code is doable with tRPC. IfEnigmatic INTERNAL SERVER ERRORIm having a problem finding out about what is causing the INTERNAL SERVER ERROR from tRPC in my prodcreateProxySSGHelpers type errorHi all! Anyone know how to use createProxySSGHelpers with appropriate createContext typing?