Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on startup #6

Open
jezzaaa opened this issue Jul 25, 2019 · 3 comments
Open

Errors on startup #6

jezzaaa opened this issue Jul 25, 2019 · 3 comments

Comments

@jezzaaa
Copy link

jezzaaa commented Jul 25, 2019

Had pre cli version running, decided to upgrade. pm2 seems to work ok but is restarting cli every few seconds. Getting this in error log:

(node:3997) [DEP0112] DeprecationWarning: Socket.prototype._ handle is deprecated RangeError: toString() radix argument must be between 2 and 36 at Number.toString (<anonymous>) at /home/pi/node_modules/mdns-cast-browser/cast-browser. js:57:26 at Buffer.forEach (<anonymous>) at /home/pi/node_modules/mdns-cast-browser/cast-browser. js:56:25 at Array.forEach (<anonymous>) at /home/pi/node_modules/mdns-cast-browser/cast-browser. js:53:26 at Array.forEach (<anonymous>) at EventEmitter.<anonymous> (/home/pi/node_modules/mdns- cast-browser/cast-browser.js:26:19) at EventEmitter.emit (events.js:188:13) at Socket.<anonymous> (/home/pi/node_modules/multicast-d ns/index.js:49:43)

I'm quite skilled on Linux but relatively new to nodejs, so I don't know how to diagnose.

@jezzaaa
Copy link
Author

jezzaaa commented Jul 25, 2019

Running from cli shows a bit more info:

pi@raspberrypi:~/.pm2/logs $ node /home/pi/node_modules/cast
-web-api/api.js
parseCallbacksJson
ms: 0
value: {"heartbeat":0}
ms: 0
cast-web-api v1.2.1
cast-web-api running at http://127.0.0.1:3000
/home/pi/node_modules/mdns-cast-browser/cast-browser.js:57

buffer = buffer.toString('utf8');

            ^

RangeError: toString() radix argument must be between 2 and
36
at Number.toString ()
at /home/pi/node_modules/mdns-cast-browser/cast-browser.
js:57:26

etc

@vervallsweg
Copy link
Owner

`/home/pi/node_modules/mdns-cast-browser/cast-browser.js:57

buffer = buffer.toString('utf8');

Apparently one of your additional records returns an integer. This is the first time I've ever seen this. I'm not even sure if the response you got there is from a Chromecast.

Anyhow the fix for this should be quite simple, since this method defaults to utf-8 anyway, we can just drop this. Then the method should work on buffers and integers.

@jezzaaa
Copy link
Author

jezzaaa commented Aug 1, 2019

Awesome, thanks bro.

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

No branches or pull requests

2 participants