Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on node v22.1.0 #5880

Closed
xlc opened this issue May 15, 2024 · 4 comments
Closed

error on node v22.1.0 #5880

xlc opened this issue May 15, 2024 · 4 comments
Assignees

Comments

@xlc
Copy link
Contributor

xlc commented May 15, 2024

node:internal/event_target:1095
  process.nextTick(() => { throw err; });
                           ^

TypeError: Cannot read properties of null (reading 'length')
    at WebSocket.__internal__onSocketMessage (file:///Users/xiliangchen/projects/acala/chopsticks/node_modules/@polkadot/rpc-provider/ws/index.js:392:40)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:821:20)
    at WebSocket.dispatchEvent (node:internal/event_target:756: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 Writable.write (node:internal/streams/writable:502:10)

Node.js v22.1.0

failed on this line

const bytesRecv = message.data.length;

the message is

MessageEvent {
  type: 'message',
  defaultPrevented: false,
  cancelable: false,
  timeStamp: 1240.624208
}

and message.data is null for some reason

to reproduce, run chopsticks on nodejs v22.1.0
Original issue AcalaNetwork/chopsticks#753

@TarikGul
Copy link
Member

Not surprised node v22 is giving some issues, but also happy to start working on giving it support.

@TarikGul
Copy link
Member

This will most likely not be a fast fix, but I will do my best to get it resolved soon!

@TarikGul TarikGul self-assigned this May 15, 2024
@TarikGul
Copy link
Member

This issue has been fixed with Nodejs 22.3.0 - The only PR i could trace this too was: https://github.com/nodejs/node/pull/52370/files

I went through a lot of rabbit holes to see what I could do to improve this locally, to not much avail. I would just recommend using 22.3.0 or above - as the lower versions had intrinsic issues with the Global WebSocket.

closing for now.

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants