-
Versions
Detailed description of a problemTypeError throws when player chatting in the server or use command Uncaught TypeError TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received undefined
at __node_internal_captureLargerStackTrace (internal/errors:484:5)
at NodeError (internal/errors:393:5)
at byteLength (buffer:740:11)
at sizeOfPString (/home/app/js/first/node_modules/protodef/src/datatypes/utils.js:127:25)
at concat (/home/app/js/first/node_modules/minecraft-protocol/src/transforms/binaryStream.js:11:45)
at client.verifyMessage (/home/app/js/first/node_modules/minecraft-protocol/src/client/play.js:20:24)
at <anonymous> (/home/app/js/first/node_modules/mineflayer/lib/plugins/chat.js:132:47)
at emit (events:513:28)
at <anonymous> (/home/app/js/first/node_modules/minecraft-protocol/src/client.js:91:12)
at emit (events:513:28)
at addChunk (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:298:12)
at readableAddChunk (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:280:11)
at Readable.push (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:241:10)
at Transform.push (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:139:32)
at _transform (/home/app/js/first/node_modules/protodef/src/serializer.js:89:10)
at Transform._read (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:177:10)
at Transform._write (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:164:83)
at doWrite (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:409:139)
at writeOrBuffer (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:398:5)
at Writable.write (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:307:11)
at ondata (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:699:22)
at emit (events:513:28)
at addChunk (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:291:12)
at readableAddChunk (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:267:9)
at Readable.push (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:209:10)
at <anonymous> (/home/app/js/first/node_modules/minecraft-protocol/src/transforms/compression.js:69:14)
at zlibBufferOnEnd (zlib:161:10)
at emit (events:513:28)
at endReadableNT (internal/streams/readable:1359:12)
at processTicksAndRejections (internal/process/task_queues:82:21)
--- TickObject ---
at init (internal/inspector_async_hook:25:19)
at emitInitNative (internal/async_hooks:202:43)
at emitInitScript (internal/async_hooks:505:3)
at nextTick (internal/process/task_queues:132:5)
at endReadable (internal/streams/readable:1348:13)
at Readable.read (internal/streams/readable:443:7)
at flow (internal/streams/readable:1023:34)
at emitReadable_ (internal/streams/readable:604:3)
at onEofChunk (internal/streams/readable:568:5)
at readableAddChunk (internal/streams/readable:275:5)
at Readable.push (internal/streams/readable:234:10)
at <anonymous> (internal/streams/transform:145:12)
at processCallback (zlib:613:8)
at callbackTrampoline (internal/async_hooks:130:17)
--- ZLIB ---
at init (internal/inspector_async_hook:25:19)
at emitInitNative (internal/async_hooks:202:43)
at Zlib (zlib:682:18)
at Unzip (zlib:784:3)
at asyncBufferWrapper (zlib:800:23)
at _transform (/home/app/js/first/node_modules/minecraft-protocol/src/transforms/compression.js:55:12)
at Transform._write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/transform.js:168:8)
at writeOrBuffer (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:341:12)
at _write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
at Writable.write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:287:10)
at ondata (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:699:22)
at emit (events:513:28)
at addChunk (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:291:12)
at readableAddChunk (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:267:9)
at Readable.push (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:209:10)
at _transform (/home/app/js/first/node_modules/minecraft-protocol/src/transforms/framing.js:61:16)
at Transform._write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/transform.js:168:8)
at writeOrBuffer (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:341:12)
at _write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
at Writable.write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:287:10)
at ondata (internal/streams/readable:766:22)
at emit (events:513:28)
at addChunk (internal/streams/readable:324:12)
at readableAddChunk (internal/streams/readable:297:9)
at Readable.push (internal/streams/readable:234:10)
at _transform (internal/crypto/cipher:154:8)
at Transform._write (internal/streams/transform:175:8)
at writeOrBuffer (internal/streams/writable:392:12)
at _write (internal/streams/writable:333:10)
at Writable.write (internal/streams/writable:337:10)
at ondata (internal/streams/readable:766:22)
at emit (events:513:28)
at addChunk (internal/streams/readable:324:12)
at readableAddChunk (internal/streams/readable:297:9)
at Readable.push (internal/streams/readable:234:10)
at onStreamRead (internal/stream_base_commons:190:23)
at callbackTrampoline (internal/async_hooks:130:17)
--- TCPWRAP ---
at init (internal/inspector_async_hook:25:19)
at emitInitNative (internal/async_hooks:202:43)
at Socket.connect (net:1095:7)
at connect (net:234:17)
at <anonymous> (/home/app/js/first/node_modules/minecraft-protocol/src/client/tcp_dns.js:25:34)
at onresolve (internal/dns/callback_resolver:47:10)
at callbackTrampoline (internal/async_hooks:130:17)
--- QUERYWRAP ---
at init (internal/inspector_async_hook:25:19)
at emitInitNative (internal/async_hooks:202:43)
at querySrv (internal/dns/callback_resolver:73:42)
at options.connect (/home/app/js/first/node_modules/minecraft-protocol/src/client/tcp_dns.js:21:13)
at authenticate (/home/app/js/first/node_modules/minecraft-protocol/src/client/microsoftAuth.js:42:11)
at processTicksAndRejections (internal/process/task_queues:95:5)
--- await ---
at createClient (/home/app/js/first/node_modules/minecraft-protocol/src/createClient.js:46:23)
at createBot (/home/app/js/first/node_modules/mineflayer/lib/loader.js:94:35)
at <anonymous> (/home/app/js/first/test.js:4:24)
at Module._compile (internal/modules/cjs/loader:1159:14)
at Module._extensions..js (internal/modules/cjs/loader:1213:10)
at Module.load (internal/modules/cjs/loader:1037:32)
at Module._load (internal/modules/cjs/loader:878:12)
at executeUserEntryPoint (internal/modules/run_main:81:12)
at <anonymous> (internal/main/run_main_module:23:47) Uncaught SyntaxError SyntaxError: Unexpected token u in JSON at position 0
at <anonymous> (/home/app/js/first/node_modules/mineflayer/lib/plugins/chat.js:135:20)
at emit (events:513:28)
at <anonymous> (/home/app/js/first/node_modules/minecraft-protocol/src/client.js:91:12)
at emit (events:513:28)
at addChunk (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:298:12)
at readableAddChunk (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:280:11)
at Readable.push (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_readable.js:241:10)
at Transform.push (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:139:32)
at _transform (/home/app/js/first/node_modules/protodef/src/serializer.js:89:10)
at Transform._read (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:177:10)
at Transform._write (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_transform.js:164:83)
at doWrite (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:409:139)
at writeOrBuffer (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:398:5)
at Writable.write (/home/app/js/first/node_modules/protodef/node_modules/readable-stream/lib/_stream_writable.js:307:11)
at ondata (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:699:22)
at emit (events:513:28)
at addChunk (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:291:12)
at readableAddChunk (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:267:9)
at Readable.push (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:209:10)
at _transform (/home/app/js/first/node_modules/minecraft-protocol/src/transforms/compression.js:52:12)
at Transform._write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/transform.js:168:8)
at writeOrBuffer (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:341:12)
at _write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
at Writable.write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:287:10)
at ondata (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:699:22)
at emit (events:513:28)
at addChunk (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:291:12)
at readableAddChunk (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:267:9)
at Readable.push (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/readable.js:209:10)
at _transform (/home/app/js/first/node_modules/minecraft-protocol/src/transforms/framing.js:61:16)
at Transform._write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/transform.js:168:8)
at writeOrBuffer (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:341:12)
at _write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
at Writable.write (/home/app/js/first/node_modules/readable-stream/lib/internal/streams/writable.js:287:10)
at ondata (internal/streams/readable:766:22)
at emit (events:513:28)
at addChunk (internal/streams/readable:324:12)
at readableAddChunk (internal/streams/readable:297:9)
at Readable.push (internal/streams/readable:234:10)
at _transform (internal/crypto/cipher:154:8)
at Transform._write (internal/streams/transform:175:8)
at writeOrBuffer (internal/streams/writable:392:12)
at _write (internal/streams/writable:333:10)
at Writable.write (internal/streams/writable:337:10)
at ondata (internal/streams/readable:766:22)
at emit (events:513:28)
at addChunk (internal/streams/readable:324:12)
at readableAddChunk (internal/streams/readable:297:9)
at Readable.push (internal/streams/readable:234:10)
at onStreamRead (internal/stream_base_commons:190:23)
at callbackTrampoline (internal/async_hooks:130:17) What did you try yet?reinstall all Your current codeconst mineflayer = require('mineflayer')
const config = require('./config.json')
const bot = mineflayer.createBot({
host: config.host2,
username: config.username,
password: config.password,
port: Number(config.port2),
version: config.version,
auth: config.auth,
disableChatSigning: true
})
bot.on('chat', (username, message) => {
console.log(message)
if (username === bot.username) return
bot.chat(message)
})
// bot.on('message', (message) => {
// console.log(message)
// })
// Log errors and kick reasons:
bot.on('kicked', console.log)
bot.on('error', console.log) Expected behaviorecho message |
Beta Was this translation helpful? Give feedback.
Answered by
amoraschi
Dec 16, 2022
Replies: 1 comment
-
1.19.2 isn't supported yet. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
fradaut
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1.19.2 isn't supported yet.