# Node Red Crashes on Dropdown Menu Selection?

**URL:** <https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898>\
**Category:** Dashboard\
**Created:** [19 January 2022 04:38 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898 "2022-01-19T04:38:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![d0ublei](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@d0ublei](https://discourse.nodered.org/u/d0ublei)\
**Post date:** [19 January 2022 04:38 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/1 "2022-01-19T04:38:39Z")

</div>

Hi all. Got a stumper here. I have been running my flows on a server for some time and using node red as a data collection tool. This is running on an older version of Node-Red, but i figured everything would come over ok in the newest release.

I am getting an error when trying to use the dropdown node. Node red will crash when i try to select one of the two options i am passing (from a change node). The options are ( from a select statement)

SELECT id FROM Grows : msg.payload : array[2]

array[2]

0: object

id: 55

1: object

id: 1

1 and 55 are displayed, but as soon as I select them node red crashes with the following:

18 Jan 23:29:32 - [red] Uncaught Exception:  
18 Jan 23:29:32 - [error] TypeError: Cannot read property 'indexOf' of undefined  
at Object.convertBack (/home/pi/.node-red/node\_modules/node-red-dashboard/nodes/ui\_dropdown.js:145:84)  
at EventEmitter.handler (/home/pi/.node-red/node\_modules/node-red-dashboard/ui.js:280:29)  
at EventEmitter.emit (events.js:412:35)  
at Socket.emit (events.js:400:28)  
at Socket.emitUntyped (/home/pi/.node-red/node\_modules/socket.io/dist/typed-events.js:69:22)  
at /home/pi/.node-red/node\_modules/socket.io/dist/socket.js:466:39  
at processTicksAndRejections (internal/process/task\_queues.js:77:11)  
nodered.service: Main process exited, code=exited, status=1/FAILURE

Flows are below:  
[flows.json](https://discourse.nodered.org/uploads/short-url/i2oeG8ca4cyRP6haSGsPYESJz0F.json) (3.7 KB)

This looks like a bug to me because it worked in an old version? Anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [19 January 2022 05:43 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/2 "2022-01-19T05:43:18Z")

</div>

Sounds like it's related to this bug:

> <https://github.com/node-red/node-red-dashboard/issues/748>
>
> \<!--
> \## Before you hit that Submit button....
> 
> This issue tracker is for prob…lems with the Node-RED-Dashboard only.
> 
> If your issue is:
> - a general 'how-to' type question,
> - a feature request or suggestion for a change
> 
> please use the Dashboard category in the \[Node-RED Forum\](https://discourse.nodered.org) or \[slack team\](https://nodered.org/slack).
> 
> You could also consider asking a question on \[Stack Overflow\](https://stackoverflow.com/questions/tagged/node-red) and tag it \`node-red\`.
> 
> That way the whole Node-RED user community can help, rather than rely on the core development team.
> 
> \## So you have a real issue to raise...
> 
> To help us understand the issue, please fill-in as much of the following information as you can:
> \--\>
> I updated various nodes today, one of which was the dashboard. Since doing so, I've encountered an issue with a dropdown selector. 
> 
> The dropdown node is being given this:
> !\[image\](https://user-images.githubusercontent.com/16157130/149621953-21c9058c-86ca-4283-84bc-1bd4e14bbe4e.png)
> 
> Selecting the string works, but errors out down the line (Isn't actually processed). However, selecting the value that is desired, in this case 79403379 cashes node Red 90+% of the time with the following error:
> \`\`\`
> 16 Jan 01:08:42 - \[error\] TypeError: Cannot read properties of undefined (reading 'indexOf')
> at Object.convertBack (/data/node\_modules/node-red-dashboard/nodes/ui\_dropdown.js:145:84)
> at EventEmitter.handler (/data/node\_modules/node-red-dashboard/ui.js:280:29)
> at EventEmitter.emit (node:events:402:35)
> at Socket.emit (node:events:390:28)
> at Socket.emitUntyped (/data/node\_modules/socket.io/dist/typed-events.js:69:22)
> at /data/node\_modules/socket.io/dist/socket.js:466:39
> at processTicksAndRejections (node:internal/process/task\_queues:78:11)
> \`\`\`
> The times it doesn't crash, it passes undefined as the payload.
> Even with striping the msg object right back, it still errors:
> 
> !\[image\](https://user-images.githubusercontent.com/16157130/149622168-fdc59dd7-04ac-40d6-bc84-7d2b1436897c.png)
> 
> \`\`\`
> 16 Jan 01:45:36 - \[error\] TypeError: Cannot read properties of undefined (reading 'indexOf')
> at Object.convertBack (/data/node\_modules/node-red-dashboard/nodes/ui\_dropdown.js:145:84)
> at EventEmitter.handler (/data/node\_modules/node-red-dashboard/ui.js:280:29)
> at EventEmitter.emit (node:events:402:35)
> at Socket.emit (node:events:390:28)
> at Socket.emitUntyped (/data/node\_modules/socket.io/dist/typed-events.js:69:22)
> at /data/node\_modules/socket.io/dist/socket.js:466:39
> at processTicksAndRejections (node:internal/process/task\_queues:78:11)
> \`\`\`
> 
> \### What are the steps to reproduce?
> 
> Pass a msg with msg.options set. The first option is a string, the rest is a list of integers. 
> Select one of the integers from the drop down box.
> 
> \### What happens?
> 
> Node red crashes with an exception.
> 
> \### What do you expect to happen?
> 
> For the dropdown box to pass the selected integer along as the msg.payload.
> 
> \### Please tell us about your environment:
> 
> \- \[\] Node-RED-Dashboard version: 3.1.4
> \- \[\] Node-RED version: 2.1.5
> \- \[\] node.js version: 16.13.1
> \- \[\] npm version: 8.1.2
> \- \[\] Platform/OS: unRaid 6.9.2
> \- \[\] Browser: Vivaldi
> \- \[\] Docker Image: nodered/node-red:latest-16

It should be fixed with the next release of the Dashboard package.

---

<div class="post-metadata">

**Author:** ![d0ublei](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@d0ublei](https://discourse.nodered.org/u/d0ublei)\
**Post date:** [19 January 2022 14:16 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/3 "2022-01-19T14:16:10Z")

</div>

Yep. This is the same issue. Thanks for linking this! I'll post my flow there as well. Wish I was better at JS, i'd love to help fix this. Node-Red has been really useful to me.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [19 January 2022 14:18 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/4 "2022-01-19T14:18:05Z")

</div>

Since the issue has already been closed, I guess it's fixed. So there's no need to post your flow there. 😉

---

<div class="post-metadata">

**Author:** ![d0ublei](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@d0ublei](https://discourse.nodered.org/u/d0ublei)\
**Post date:** [19 January 2022 15:36 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/5 "2022-01-19T15:36:42Z")

</div>

Yeah I see the commit here for the 3.1.5 release:

> <https://github.com/node-red/node-red-dashboard/commit/dc7de9a59bb816b7132f5c2c254cb5214e2238de>
>
> to close #748

What is the usual lag time before this can be updated with npm?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 January 2022 16:16 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/6 "2022-01-19T16:16:29Z")

</div>

usually fairly short - but someone else mentioned another bug in dropdown and hasn't posted a way to repeat it so I'm waiting on that in case I can fix both, rather than do two releases.  
If you want you can always install direct from git using

```auto
cd ~/.node-red
npm i node-red/node-red-dashboard

```

---

<div class="post-metadata">

**Author:** ![d0ublei](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@d0ublei](https://discourse.nodered.org/u/d0ublei)\
**Post date:** [19 January 2022 18:48 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/7 "2022-01-19T18:48:48Z")

</div>

For some reason this is hanging when I try to install this (This is how i orignally installed the package):  
**pi@ABDC01** : **~/.node-red $** npm i node-red/node-red-dashboard

[..................] | rollbackFailedOptional: verb npm-session cbb1a380470aeb6a  
It just hangs at the above line.

I uninstalled the package before doing this to see if that was the root cause, it was not.  
Any ideas? This is on a Pi Zero so i get why its somewhat slow, but it should complete in at least 5 minutes.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 January 2022 18:53 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/8 "2022-01-19T18:53:20Z")

</div>

Hmm. I have seen it take ages from GitHub. Must admit yarn is a lot faster than npm.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 January 2022 09:25 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/9 "2022-01-20T09:25:30Z")

</div>

> [@d0ublei](#):
>
> it should complete in at least 5 minutes.

On a Zero it might take a very long time when installing direct from git. I don't think it has been determined why that is the case. Give it a few hours before giving up. If you run `top` in another terminal you can see that it is still doing things.

---

<div class="post-metadata">

**Author:** ![d0ublei](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@d0ublei](https://discourse.nodered.org/u/d0ublei)\
**Post date:** [20 January 2022 15:53 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/10 "2022-01-20T15:53:44Z")

</div>

It did eventually try to install but eventually failed with this error:

npm ERR! prepareGitDep gyp ERR! System Linux 5.10.63+

npm ERR! prepareGitDep gyp ERR! command "/usr/bin/node" "/home/pi/.npm/\_cacache/tmp/git-clone-67b8b295/node\_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass\_ext=" "--libsass\_cflags=" "--libsass\_ldflags=" "--libsass\_library="

npm ERR! prepareGitDep gyp ERR! cwd /home/pi/.npm/\_cacache/tmp/git-clone-67b8b295/node\_modules/node-sass

npm ERR! prepareGitDep gyp ERR! node -v v14.18.1

npm ERR! prepareGitDep gyp ERR! node-gyp -v v3.8.0

npm ERR! prepareGitDep gyp ERR! not ok

npm ERR! prepareGitDep Build failed with error code: 1

Im going to be out of town until Monday but will try again then if the package hasn't been pushed to the official node-red repo yet

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 January 2022 16:09 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/11 "2022-01-21T16:09:15Z")

</div>

Dashboard v3.1.5 now released

---

<div class="post-metadata">

**Author:** ![d0ublei](https://avatars.discourse-cdn.com/v4/letter/d/ba9def/32.png) [@d0ublei](https://discourse.nodered.org/u/d0ublei)\
**Post date:** [23 January 2022 22:05 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/12 "2022-01-23T22:05:13Z")

</div>

This fixed my issue! Thanks so much for the work on this module.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 February 2022 22:05 UTC](https://discourse.nodered.org/t/node-red-crashes-on-dropdown-menu-selection/56898/13 "2022-02-06T22:05:27Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
