ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
305 stars 18 forks source link

error: TypeError: The "listener" argument must be of type function #135

Closed AdeTheux closed 1 year ago

AdeTheux commented 1 year ago

Just noticed an error from this plugin after restarting Homebridge. Everything still works after the reboot, though. Does this mean another plugin is colliding with the rpi one?

Homebridge 1.5 homebridge-rpi v1.3.24

Received an instance of Object
    at checkListener (node:events:259:3)
    at ClientRequest.once (node:events:661:3)
    at new ClientRequest (node:_http_client:215:10)
    at Object.request (node:https:353:10)
    at Object.request (/usr/lib/node_modules/homebridge-broadband/node_modules/http-proxy-agent/node_modules/agent-base/patch-core.js:25:22)
    at /usr/lib/node_modules/homebridge-rpi/node_modules/homebridge-lib/lib/HttpClient.js:361:34
    at new Promise (<anonymous>)
    at HttpClient.request (/usr/lib/node_modules/homebridge-rpi/node_modules/homebridge-lib/lib/HttpClient.js:338:12)
    at HttpClient.get (/usr/lib/node_modules/homebridge-rpi/node_modules/homebridge-lib/lib/HttpClient.js:277:17)
    at RpiPlatform._checkLatest (/usr/lib/node_modules/homebridge-rpi/node_modules/homebridge-lib/lib/Platform.js:404:47)
    at RpiPlatform._beat (/usr/lib/node_modules/homebridge-rpi/node_modules/homebridge-lib/lib/Platform.js:281:12)
    at Timeout._onTimeout (/usr/lib/node_modules/homebridge-rpi/node_modules/homebridge-lib/lib/Platform.js:186:29)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
ebaauw commented 1 year ago

I’m afraid it does. The http-proxy-agent library is known to break https, by “patching” the standard NodeJS functionality. Better run homebridge-broadband in a separate child bridge.

See https://github.com/ebaauw/homebridge-hue/issues/629 and many issues linking to that issue.

I think Homebridge RPi only uses https to check the NPM registry for its latest version, so in this case, functionality wouldn’t be impacted.