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
1.21.4
Current Behavior
Node process occasionally crashes when using reactContract with a websocket transport.
The error is likely triggered by invalid server server responses. We're using QuickNode.
However, I don't see a way to catch this error in user code since it occurs in Viem's internal WS message handler. The error is not passed back to readContract caller. Note how entire call stack is native code > viem:
[VIEM] request 84532 eth_getBlockByNumber
TypeError: Cannot read properties of null (reading 'method')
at WebSocket.onMessage (/Users/dc/code/daimo/node_modules/viem/utils/rpc.ts:185:40)
at WebSocket.[nodejs.internal.kHybridDispatch] (node:internal/event_target:816:20)
at WebSocket.dispatchEvent (node:internal/event_target:751:26)
at fireEvent (node:internal/deps/undici/undici:10966:14)
at websocketMessageReceived (node:internal/deps/undici/undici:10988:7)
at ByteParser.run (node:internal/deps/undici/undici:11439:17)
at ByteParser._write (node:internal/deps/undici/undici:11315:14)
at writeOrBuffer (node:internal/streams/writable:564:12)
at _write (node:internal/streams/writable:493:10)
at ByteParser.Writable.write (node:internal/streams/writable:502:10)
Node.js v22.2.0
Expected Behavior
RPC response errors should be passed back to the caller.
Steps To Reproduce
Intermittent issue, probably triggered by bad RPC responses.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
This issue has been locked since it has been closed for more than 14 days.
If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.
Check existing issues
Viem Version
1.21.4
Current Behavior
Node process occasionally crashes when using
reactContract
with a websocket transport.The error is likely triggered by invalid server server responses. We're using QuickNode.
However, I don't see a way to catch this error in user code since it occurs in Viem's internal WS message handler. The error is not passed back to
readContract
caller. Note how entire call stack is native code > viem:Expected Behavior
RPC response errors should be passed back to the caller.
Steps To Reproduce
Intermittent issue, probably triggered by bad RPC responses.
Anything else?
No response
The text was updated successfully, but these errors were encountered: