Skip to content

Conversation

@MinePlay85
Copy link

@MinePlay85 MinePlay85 commented May 8, 2025

Hello everyone,

I see recently that rustplus.js got a problem with the buffer after Rust May update. It say:

C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\node_modules\protobufjs\src\reader.js:98
            throw indexOutOfRange(this, 10);
            ^

RangeError: index out of range: 9 + 10 > 9
    at indexOutOfRange (C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\node_modules\protobufjs\src\reader.js:13:12)
    at BufferReader.read_uint32 [as uint32] (C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\node_modules\protobufjs\src\reader.js:98:19)
    at Type.AppResponse$decode [as decode] (eval at Codegen (C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\node_modules\@protobufjs\codegen\index.js:50:33), <anonymous>:15:33)
    at Type.decode_setup [as decode] (C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\node_modules\protobufjs\src\type.js:507:25)
    at Type.AppMessage$decode [as decode] (eval at Codegen (C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\node_modules\@protobufjs\codegen\index.js:50:33), <anonymous>:11:23)
    at WebSocket.<anonymous> (C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\rustplus.js:78:47)
    at WebSocket.emit (node:events:507:28)
    at Receiver.receiverOnMessage (C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\node_modules\ws\lib\websocket.js:1220:20)
    at Receiver.emit (node:events:507:28)
    at Receiver.dataMessage (C:\Users\mathy\OneDrive\WebstormProjects\hedarustbot\node_modules\@liamcottle\rustplus.js\node_modules\ws\lib\receiver.js:569:14)

Node.js v23.1.0

I got a fix in the update to make like a 'paded' in the package we got. No consequence on the message received i found. Maybe it's a a temporary fix. I will try to find another fix.

Goodbye!

Copy link

@Oxrunner Oxrunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you that works, I've had this issue for a few days and just had a try catch around the reading of the message for now as not had time to look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants