NorthernMan54 / homebridge-alexa

Expose your homebridge controlled devices to Amazon Alexa.
https://www.homebridge.ca
442 stars 77 forks source link

Range error on shim-array #481

Closed aaronkbutler closed 2 years ago

aaronkbutler commented 2 years ago

I’m getting an error in the Homebridge console every few minutes which causes Homebridge to restart.

61177D18-751C-40CA-ACC8-A65586682C54

NorthernMan54 commented 2 years ago

Something weird is happening here. The package collections and shim-array are not a dependency of homebridge-alexa. Did you make any recent changes or are you running something non-standard ?

Have you tried removing the plugin and re-installing ?

aaronkbutler commented 2 years ago

The issue seems to arise whenever I set routines to true in my config.

aaronkbutler commented 2 years ago

Turned out to be an issue with another plugin I was using. Once I got rid of that, I was able to enable routines and everything runs smoothly.

NorthernMan54 commented 2 years ago

Which plugin ?

On Dec 25, 2021, at 2:38 PM, aaronkbutler @.***> wrote:

 Turned out to be an issue with another plugin I was using. Once I got rid of that, I was able to enable routines and everything runs smoothly.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.

aaronkbutler commented 2 years ago

homebridge-myq

NebzHB commented 2 years ago

Hello @NorthernMan54, it seems the package collections is used by the packages mqtt you have dependencies on. I haven't got the problem myself, but I've encountered it on users using other plugins than the one mentioned by @aaronkbutler. I ask the plugin list to the users who had the problem and let you know.

NorthernMan54 commented 2 years ago

@NebzHB I went and looked at the collections package, and they have this issue mentioned

https://github.com/montagejs/collections/issues/241

need to read it in detail to see what they are saying

NebzHB commented 2 years ago

It seems they fixed it in march (with a quick overview of the issue)...

Edit : my 2 users are on rpi 3b with nodejs 14. I can't reproduce on a debian vm

NebzHB commented 2 years ago

Hello again @NorthernMan54,

I see you are using a version 2.x of mqtt. And they are version 4.x, could it be that ?

i have the plugin list of one of my users : homebridge-ring homebridge-adb homebridge-broadlink-rm-pro (using mqtt 4.x) homebridge-ewelink homebridge-config-ui-x homebridge-camera-ffmpeg homebridge-gsh homebridge-alexa (of course ;))

NorthernMan54 commented 2 years ago

I have a major renovation planned for this winter, and that is one of many items on the backlog.

NebzHB commented 2 years ago

have a third user with the problem : Rpi3+/buster, plugin list : homebridge-alexa @ 0.5.42 - Control your Homebridge devices with Amazon Alexa. homebridge-camera-ffmpeg @ 3.1.3 - Homebridge Plugin Providing FFmpeg-based Camera Support homebridge-config-ui-x @ 4.41.5 - A web based management, configuration and control platform for Homebridge homebridge-gsh @ 2.2.0 - Google Smart Home

NebzHB commented 2 years ago

i can reproduce on my debian vm ! tried to install collections globally but it's still installed by homebridge-alexa in his node_modules folder...

NorthernMan54 commented 2 years ago

@NebzHB Well I was able to recreate the issue by installing myq into my development environment. So far I have tried updating the mqtt package version to the latest version, nope, and then tried the same version as myq, same. I then went and implemented the collections fix to homebridge-alexa ie added "collections": "github:montagejs/collections#85f00f8", to package.json, same. I then added it to myq as well, and success.

Am thinking the only true fix is to have collections package publish the release.

NebzHB commented 2 years ago

strange.. none of my users uses myq... on my own system, i fixed it with adding if(!Array.from) {} wrap around the function re-defining Array.from in collections (as proposed in one of their PR (#https://github.com/montagejs/collections/pull/212)) see https://github.com/NebzHB/collections/blob/master/shim-array.js#L33 . I see in original Issue of Collections that camera-ffmpeg does have the issue too (#https://github.com/Sunoo/homebridge-camera-ffmpeg/issues/1240) and ring throw the issue away too #https://github.com/dgreif/ring/issues/844 ... it seems the error message sticks to the first plugin using mqtt... There will be hot-potato game in that case ;)

NebzHB commented 2 years ago

Another user with mqttthings plugin, it seems all plugins using mqtt have the issue. image

NorthernMan54 commented 2 years ago

@aaronkbutler if you can try updating to the latest version, I implemented a workaround for the issue.

NebzHB commented 2 years ago

your fix works for me :)

NorthernMan54 commented 2 years ago

Tks closing this

aaronkbutler commented 2 years ago

@aaronkbutler if you can try updating to the latest version, I implemented a workaround for the issue.

Thanks for working on this! Works great now.