wobsoriano / trpc-nuxt

End-to-end typesafe APIs in Nuxt applications.
trpc-nuxt.vercel.app
MIT License
687 stars 39 forks source link

TRPCError.message not forwarded to client #143

Closed CharlesBT closed 9 months ago

CharlesBT commented 10 months ago

Hi the trpc-client doesn't cach properly the TRPCError and did not forward TRPCError.message.

I had to edit ./dist/client/index.mjs of your package to replace line 94 if (e instanceof FetchError && e.response) { by if (e.constructor.name === "FetchError" && e.response) {

If there is no nasty border effect could you integrate this fix in the next release Thanks :)

wobsoriano commented 9 months ago

That is weird. It works on my machine 😆. I'm wondering what might be causing the issue, though. Is it because I'm importing FetchError from ofetch?

wobsoriano commented 9 months ago

Released a new version but before you upgrade, can you try if installing ofetch fixes your issue?