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

installing ui-led before installing the dashboard causes the led not to show up in the dashboard #56

Closed
juggledad opened this issue Oct 4, 2020 · 7 comments

Comments

@juggledad
Copy link

Describe the bug
If you install the ui-led node before installing the dashboard, then install the dashboard, using the led node in a flow will show an error in the log and the led will not appear in the dashboard

To Reproduce
Steps to reproduce the behavior:

  1. ...install the ui-led node
  2. ...instll node-red-dashboard
  3. ...use the led node in a flow

Expected behavior
the led should appear and no error should happen

Screenshots
here is what hows up in the log

4 Oct 06:32:00 - [info] Starting flows
While constructing LEDNode widget: Error: Cannot find module 'node-red-dashboard'
    at Object.requireModule [as require] (/usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/util.js:48:19)
    at new LEDNode (/home/pi/.node-red/node_modules/node-red-contrib-ui-led/led.js:13:26)
    at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/util.js:483:31)
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:189:48)
    at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:329:33)
    at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:196:21
    at processTicksAndRejections (internal/process/task_queues.js:94:5) {
  code: 'MODULE_NOT_FOUND'
}
TypeError: Cannot read property 'padEnd' of undefined
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:237:62)
    at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:329:33)
    at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:196:21
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
4 Oct 06:32:00 - [info] Started flows

Versions

  • node-red-contrib-ui-led: 0.3.3
  • node-red: 1.0.3 - 1.1.3
  • node-red-dashboard: 2.23.4

Platform

  • OS: [e.g. iOS] rpi - buster 10
  • Browser [e.g. chrome, safari] safari
  • Version [e.g. 22] 0.13.04

Additional context
shutting node-red down and restarting it fixes the issue.

@dceejay
Copy link
Contributor

dceejay commented Oct 4, 2020

This is probably due to the way Node-RED loads modules. It will generally add them in the order in which it finds them in the flow file, but will try to load any config nodes first. So when you add them in this order - and thus before Node-RED has restarted and rescanned for config nodes (which the dashboard has) - the led node will load first and not find the dashboard as it has't loaded yet. On a restart it will find the dashboard config nodes first and thus load that up first - so by the time it loads the led then the dashboard is there.

@yoiang
Copy link
Member

yoiang commented Oct 6, 2020

Great find! Hmm, is there a way to clarify to Node-RED that dashboard is a dependency re: loading order? Or would the best way to make it a package dependency?

@dceejay
Copy link
Contributor

dceejay commented Oct 7, 2020

it is only an issue in this specific edge case where the user add the led node first, then adds the dashboard, and is fixed on a restart. Most users would have dashboard installed already, then add extra nodes to it so would never see this. Or on a new install if a load of nodes were added at install time - again it won't happen as it will start in correct order.
If you make it a full dependency then there are occasions when it would then pull in a complete duplicate set of dashboard nodes which may then conflict with any existing ones. If you make it a peer-dependency then you will get a warning - but that is all and the user will still get the same behaviour.

@juggledad
Copy link
Author

Since it is shown as an issue here and on the forum and it has only happened once, if anyone else hits it, if they search they should find out the cause. I don't think you need to do anything. I was reporting it (mainly as an FYI) since I discovered it helping a user resolve it. Maybe give it a label to indicate it as a 'one timebug - just reboot'

@yoiang
Copy link
Member

yoiang commented Oct 7, 2020

👍 🤘

@LarryReader
Copy link

Hello, I am a bit of a newbie but have an number of other installed nodes working. I just installed the ui-led node like this node-red-contrib-ui-led under Manage Palette. I installed after the dashboard and it is not showing up. Have it in a group as other ui nodes. I'm in Node_Red on a VM on Google Compute Engine and honestly have not needed to or figured out how to restart nodered yet or the VM for that matter but seems I should not have to go there anyway?

@yoiang
Copy link
Member

yoiang commented Oct 13, 2020

hey @LarryReader ! Would you be able to copy the palette and paste it here? That way I can recreate the arrangement and see if I can reproduce the problem!

This isn't related to the original issue so I'm closing it for now

@yoiang yoiang closed this as completed Oct 13, 2020
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

4 participants