Open Ryanjso opened 15 hours ago
This is my way of hacking it for now, but obviously less than ideal
export const isTRPCClientError = (error: unknown): error is TRPCClientError<AppRouter> => {
return typeof error === 'object' && error !== null && error['name'] === 'TRPCClientError'
}
// inside catch block
if (isTRPCClientError(error)) {
// error is now a TRPCClientError
}
I'm having trouble getting errors to show up correctly as instances of the TRPCClientError class. If you
console.log(err.constructor.name)
it's always_y
It seems it's being minified by
Vite
somewhere but I've played with the configuration a lot and can't seem to figure out anything different.I realize this may be a Vite issue more so than an
electron-trpc
issue but I imagine everyone here is likely facing this so curious of a fix.This issue happens in my own repo and this repos example basic-react project