PrismarineJS / prismarine-chat

A parser for a minecraft chat message
MIT License
34 stars 21 forks source link

RangeError: Invalid string length #110

Closed Yaodeowo closed 6 months ago

Yaodeowo commented 6 months ago

C:\Users\admin\Desktop\NCloopBot\node_modules\prismarine-chat\format.js:6 return string.replace(/%(?:(\d+)\$)?(s|%)/g, (g0, g1) => { ^

RangeError: Invalid string length at String.replace () at format (C:\Users\admin\Desktop\NCloopBot\node_modules\prismarine-chat\format.js:6:17) at ChatMessage.toString (C:\Users\admin\Desktop\NCloopBot\node_modules\prismarine-chat\index.js: 307:20) at C:\Users\admin\Desktop\NCloopBot\node_modules\prismarine-chat\index.js:305:47 at Array.map () at ChatMessage.toString (C:\Users\admin\Desktop\NCloopBot\node_modules\prismarine-chat\index.js: 305:28) at C:\Users\admin\Desktop\NCloopBot\node_modules\prismarine-chat\index.js:305:47 at Array.map () at ChatMessage.toString (C:\Users\admin\Desktop\NCloopBot\node_modules\prismarine-chat\index.js: 305:28) at C:\Users\admin\Desktop\NCloopBot\node_modules\prismarine-chat\index.js:305:47

Node.js v18.17.1

why? use command: /tellraw @a {"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":[{"translate":"%1$s.%1$s.%1$s.%1$s","with":["ⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫⅫ"]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}]}

extremeheat commented 6 months ago

Why are you re-opening https://github.com/PrismarineJS/prismarine-chat/issues/108 ?

Yaodeowo commented 5 months ago

because it range error

Why are you re-opening #108 ?

extremeheat commented 5 months ago

The issue board is not a complaint board, it’s for valid issues in the repo. Your stack trace indicates you are running an old version of the package. As mention in the other issue you need to update your dependencies when bugs are fixed upstream, they will not update themselves.