pushrax / node-rcon

A generic RCON protocol client for node.js
MIT License
134 stars 31 forks source link

Invalid Arg type #33

Closed SpiderUnderUrBed closed 3 years ago

SpiderUnderUrBed commented 3 years ago

Is this a internal issue with rcon or did I do something wrong?

buffer.js:724 throw new ERR_INVALID_ARG_TYPE( ^ TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received null at Function.byteLength (buffer.js:724:11) at Rcon.send (/home/container/node_modules/rcon/node-rcon.js:51:25) at Rcon.socketOnConnect (/home/container/node_modules/rcon/node-rcon.js:180:10) at Socket. (/home/container/node_modules/rcon/node-rcon.js:88:53) at Socket.emit (events.js:326:22) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1131:10) { code: 'ERR_INVALID_ARG_TYPE' }

Code: const options = { tcp: true, challenge: false }; let client = new rcon('127.0.0.1', '(Censored)', null, options); client.on('auth', function() { console.log("Authed!"); }).on('response', function(str) { console.log("Got response: " + str);

}).on('end', function() { console.log("Socket closed!"); });

client.connect(); Its for my minecraft server

SpiderUnderUrBed commented 3 years ago

nvm fixed