You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked there isn't already an issue for the bug I encountered.
Viem Version
2.21.55
Current Behavior
Some provider return a string on error, here getBlock.io, return a string "rate limit reached" instead of an object:
Error
SyntaxError: Unexpected token 'r', "rate limit reached" is not valid JSON
at JSON.parse (<anonymous>)
at WebSocket.onMessage (.../node_modules/viem/utils/rpc/webSocket.ts:39:25)
Websocket.ts
function onMessage({ data }: MessageEvent) {
onResponse(JSON.parse(data))
}
I'm calling RPC function "getBlockReceipts" after subscribing to newHeads event.
Check existing issues
Viem Version
2.21.55
Current Behavior
Some provider return a string on error, here getBlock.io, return a string "rate limit reached" instead of an object:
Error
Websocket.ts
I'm calling RPC function "getBlockReceipts" after subscribing to newHeads event.
Expected Behavior
No response
Steps To Reproduce
Link to Minimal Reproducible Example
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: