Error displays as an empty object
See original GitHub issueWhen my query function throws an error, the devtools displays it as an empty object.
I would expect it to display the message
and maybe stack
string properties that the object contains.
If I throw a custom error with additional properties, such as status
, it shows up just fine in the devtools. So it seems to only be the default error properties that are not being shown.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
How to avoid empty object error in a loop using Google Apps ...
I'm calling an API and getting data going through its pagination. When I get to the last page, though, the obejct giving me...
Read more >How to Check if Object is Empty in JavaScript - Samantha Ming
Checking empty object with JavaScript It returns true for objects. And we're covered for null and undefined . It will return false and...
Read more >LWC controller returns empty objects
I have a problem. Every time, when I'm trying to execute quick action i see this error-message: [e.opportunity is undefined]. Can somebody help ......
Read more >TypeError: Reduce of empty array with no initial value
This problem appears frequently when combined with a filter ( Array.prototype.filter() , TypedArray.prototype.filter() ) which will remove all elements of the ...
Read more >Object store v2 store operation does not throw error when Fail ...
This works as designed because when you pass an empty array this is equivalent to passing an empty string and this is not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
yeah let’s reopen this and fix it for v4. We initially only used
JSON.stringify
to display the values, but lots of things (Error
included) is not json serializable. That’s why an object works, but an Error instance does not. Now, we have a custom function that serializesBigInt
differently already:https://github.com/TanStack/query/blob/1b918c2e8897e970a471624f7f075026db24e15b/packages/react-query-devtools/src/utils.ts#L117-L126
My idea would be to just use superjson here to cover all cases.
I think we can do:
and then just ignore the
meta
?https://github.com/blitz-js/superjson#advanced-usage