janispritzkau/mc-server-status

TypeError: Cannot read property 'includes' of undefined

Closed this issue · 4 comments

when used as

try{
 let status = await getStatus("2b2t.org")
  console.log(status) 
}
catch(error) {
  console.log(error)
}

TypeError: Cannot read property 'includes' of undefined
at Client.connect (/node_modules/mcproto/lib/client.js:26:27)
at Function.connect (/node_modules/mcproto/lib/client.js:23:23)
at /node_modules/mc-server-status/lib/index.js:19:43
at Generator.next ()
at /node_modules/mc-server-status/lib/index.js:8:71
at new Promise ()
at __awaiter (/node_modules/mc-server-status/lib/index.js:4:12)
at exports.getStatus (/node_modules/mc-server-status/lib/index.js:17:34)
at /routes/index.js:9:21
at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)

looks like the host is undefined for some reason. The app works fine when invoked from the console, but I would like to use it as a library.

I am having this issue as well

For me appears the same with the example that they show.

Fixed in version 2.0.0. My apologies for having pushed an unfinished version to npm previously.