tRPCttRPC
Powered by
jove4015J
tRPC•3y ago•
1 reply
jove4015

"Unable to transform response from server" when 401 error returned from middleware (sometimes)

I'm trying to figure out a problem where some (a few, not most) 401 error responses result in an uncaught TransformError "Unable to transform response from server". This does not happen a lot but it does hit our sentry at least once a day. 401 error responses happen all the time (particularly when JWTs expire) and in 99.9999% of cases they are handled correctly.

However, every once in a while, you'll see this happen if you're watching the transformResult code (see attached screenshot).

This "null" response object comes through after the correct 401 error response has already been processed correctly, so it seems to be an extra, erroneous run through the transformResult function.

Any troubleshooting tips or insights on this would be really appreciated - we have no idea where this null is coming from and no route that we have consistently (or even usually) produces this result, it almost seems totally random except it's always in the context of a 401 error response happening.
image.png
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

TRPCClientError: Unable to transform response from server
Luiz F. A. MoraisLLuiz F. A. Morais / ❓-help
2y ago
TRPCClientError: Unable to transform response from server
2035Builder22035Builder / ❓-help
2y ago
TRPCClientError: Unable to transform response from server
Wojciech MorawskiWWojciech Morawski / ❓-help
3y ago