-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Uncaught Exception: Cannot read properties of undefined (reading 'length') #302
Comments
The responsible line in messages.js seems to be
Is seems that the lookup of The fields If you need further information or details, please let me know. |
Hello, |
Hi all, same here for me. NodeRed crashing since a couple of days with the very same error message.
|
Hello, not sure when Foddy will have time to investigate / fix this so maybe my temporary solution also helps you. Regards Jörg |
I tried upgrading from 3.0.0 and it looks like I have the same exception. I've reverted back to 3.0.0 which (obviously?) fixed the issue. Thank you for posting the work-around, I might try that later. |
@jeroenhendricksen please note that the migration to 4.X.X also requires some additional adjustment to the nodes as stated here because of the UUIDs in the API. |
Currently facing the same issues and this prevent NR from starting. |
@unclej84 this got me up and running again - thank you. |
Same issue on a fresh installation, not upgrading from a previous version. |
Hi @unclej84 , wouldn't it be better to change the respective lines like this:
and
|
Hi @ptweety, I am not so deep in JS to know if the evaluation already stops when the first &&-part stops or if he is still trying to evaluate the second part which throws the error. So, I have to rely on your knowledge here. The second part of course looks good. But anyway, the question is why it does not get the information when I see them in the API. For error handling your solution is good but still the - let's say underlying issue - should be investigated and hopefully solved. |
Well, the issue is simply that the structure of the incoming data (i.e. the resource object) is not guaranteed. e.g.:
You can see, that there is no in Line 34 there is a proper check already in the code:
|
Hi @ptweety Thanks! Your solution works fine! |
Any chance that this can be merged? |
Thanks for the tip @isaac-the-newt, but it doesn't help when this error stops Node Red from being able to start. |
* Commands are now re-executed up to three times if they fail due to a bridge timeout * The "image" option on the "Hue Light" node will now set the corresponding gradient colors on supported resources * Better handling of broken connections to the bridge ([#309](#309)) (thx) * Fixed an error with the "Hue Scenes" node on newer bridge firmwares ([#335](#335)) ([#339](#339)) (thx) * Fixed an error with uncaught exception on newer bridge firmwares ([#302](#302)) ([#309](#309)) (thx) * Updated dependencies to the latest versions * Fixed some typos here and there
Hi Foddy, Thanks for the update. 21 Mar 11:00:38 - [info] [hue-bridge:Philips hue] Initializing the bridge (192.168.0.150)… |
Hi @isaac-the-newt, |
Describe the bug
Updated NodeRED to 2.2.0 (NodeJS 16) today and no I constantly get Uncaught exception errors on starting up
Expected behavior
No crash on startup
Log
TypeError: Cannot read properties of undefined (reading 'length') at new HueBridgeMessage (/data/node_modules/node-red-contrib-huemagic/huemagic/utils/messages.js:17:61) at HueBridge.get (/data/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:306:23) at /data/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge.js:84:30 at EventEmitter.<anonymous> (/data/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:556:7) at EventEmitter.emit (node:events:390:28) at EventEmitter.emit (node:domain:475:12) at HueBridge.pushUpdatedState (/data/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:275:16) at Timeout._onTimeout (/data/node_modules/node-red-contrib-huemagic/huemagic/hue-bridge-config.js:177:13) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7)
Please complete the following information:
Additional context
Problem occured after upgrade to Node-RED 2.2.0 but even reverting image back to 2.1.6 does not work. Before it worked with 4,1.0 on 2.1.6
The text was updated successfully, but these errors were encountered: