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

Gauge error "TypeError: Cannot read property 'value' of undefined" #649

Closed
6 tasks
Verbecqb opened this issue Dec 13, 2020 · 10 comments · Fixed by kevinGodell/node-red-dashboard#1
Closed
6 tasks

Comments

@Verbecqb
Copy link

What are the steps to reproduce?

insert a gauge and deploy

What happens?

Debug - "TypeError: Cannot read property 'value' of undefined"

What do you expect to happen?

No error, works well with previous dashboard UI versions

Please tell us about your environment:

  • Node-RED-Dashboard version: 2.2.5
  • Node-RED version: 1.2.6
  • node.js version:
  • npm version:
  • Platform/OS: Mac and RPI
  • Browser: Chrome
@dceejay
Copy link
Member

dceejay commented Dec 13, 2020

Have you flushed your browser cache since upgrading ?
When you say insert a gauge and deploy... is that really all ? are you sending it any data ? Are you starting with a blank flow ?
Where are you seeing this error ?
A bit more context please.

@LukeBH
Copy link

LukeBH commented Dec 18, 2020

I have the same error coming up in the debug panel for gauges that were already on my dashboard and are receiving temperature data. Although present on the flow they are not displayed on the dashboard. When deploying any updates (even just modified flows) this error is received for each existing gauge. Clearing browser cache makes no difference.

@dceejay
Copy link
Member

dceejay commented Dec 18, 2020

can someone please share a small flow that exhibits this behaviour ? thanks

@LukeBH
Copy link

LukeBH commented Dec 18, 2020

Here you go:
[{"id":"db11ae19.eb59c","type":"tab","label":"Gauge Example","disabled":false,"info":""},{"id":"c1d34b18.62dd08","type":"inject","z":"db11ae19.eb59c","name":"","topic":"","payload":"21","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":80,"wires":[["8af682e6.6df8f"]]},{"id":"8af682e6.6df8f","type":"ui_gauge","z":"db11ae19.eb59c","name":"Example Gauge","group":"67caf490.89b3fc","order":2,"width":"3","height":"2","gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":280,"y":80,"wires":[]},{"id":"67caf490.89b3fc","type":"ui_group","z":"","name":"Controls","tab":"ec657056.f7f5d","order":1,"disp":true,"width":"6","collapse":false},{"id":"ec657056.f7f5d","type":"ui_tab","z":"","name":"System","icon":"memory","order":13,"disabled":false,"hidden":false}]

@LukeBH
Copy link

LukeBH commented Dec 18, 2020

I rolled back to 2.24.2 and restarted Node-RED and gauges are working again, so seems to be a bug in this release.

@dceejay
Copy link
Member

dceejay commented Dec 19, 2020

Hmm - no - that works fine for me... just opening that as a flow. click the inject... no error. = - gauge set to 21.

@carefulcomputer
Copy link

carefulcomputer commented Dec 23, 2020

same error. created a brand new gauge node with no inputout or values and all default settings. Get the error on deploy in debug panel

TypeError: Cannot read property 'value' of undefined

This happens at deploy only. Widget itself doesn't load in dashbaord (regardless of type of gauge node) and injecting data to that node doesn't do anything (no error etc) after deploy. In logs here is full error message which appears as soon as i hit deploy button.

Dec 22 19:23:48 myserver node-red[1229906]: 22 Dec 19:23:48 - [error] [ui_gauge:5a28c9ab.864088] TypeError: Cannot read property 'value' of undefined
Dec 22 19:23:48 myserver node-red[1229906]:     at new GaugeNode (/home/myuser/.node-red/node_modules/node-red-dashboard/nodes/ui_gauge.js:32:111)
Dec 22 19:23:48 myserver node-red[1229906]:     at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/util.js:493:31)
Dec 22 19:23:48 myserver node-red[1229906]:     at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:194:48)
Dec 22 19:23:48 myserver node-red[1229906]:     at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:345:33)
Dec 22 19:23:48 myserver node-red[1229906]:     at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:210:21

Rolling back to 2.24.2 and restarting worked.

@rysiok
Copy link

rysiok commented Dec 27, 2020

Gauge is not working (with the error "TypeError: Cannot read property 'value' of undefined") when "Angular theme everywhere" is set.
I've tested on fresh and clean Node-Red 1.2.6 install with dashboard 2.26.0 only.

[ { "id": "db9a4040.e1ba5", "type": "tab", "label": "Flow 1", "disabled": false, "info": "" }, { "id": "3d678244.012a5e", "type": "ui_tab", "name": "Home", "icon": "dashboard", "disabled": false, "hidden": false }, { "id": "ed0f4415.9973a8", "type": "ui_base", "theme": { "name": "theme-light", "lightTheme": { "default": "#0094CE", "baseColor": "#0094CE", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", "edited": true, "reset": false }, "darkTheme": { "default": "#097479", "baseColor": "#097479", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", "edited": false }, "customTheme": { "name": "Untitled Theme 1", "default": "#4B7930", "baseColor": "#4B7930", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" }, "themeState": { "base-color": { "default": "#0094CE", "value": "#0094CE", "edited": false }, "page-titlebar-backgroundColor": { "value": "#0094CE", "edited": false }, "page-backgroundColor": { "value": "#fafafa", "edited": false }, "page-sidebar-backgroundColor": { "value": "#ffffff", "edited": false }, "group-textColor": { "value": "#1bbfff", "edited": false }, "group-borderColor": { "value": "#ffffff", "edited": false }, "group-backgroundColor": { "value": "#ffffff", "edited": false }, "widget-textColor": { "value": "#111111", "edited": false }, "widget-backgroundColor": { "value": "#0094ce", "edited": false }, "widget-borderColor": { "value": "#ffffff", "edited": false }, "base-font": { "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" } }, "angularTheme": { "primary": "indigo", "accents": "blue", "warn": "red", "background": "grey" } }, "site": { "name": "Node-RED Dashboard", "hideToolbar": "false", "allowSwipe": "false", "lockMenu": "false", "allowTempTheme": "none", "dateFormat": "DD/MM/YYYY", "sizes": { "sx": 48, "sy": 48, "gx": 6, "gy": 6, "cx": 6, "cy": 6, "px": 0, "py": 0 } } }, { "id": "a62b049e.7938a8", "type": "ui_group", "name": "Default", "tab": "3d678244.012a5e", "order": 1, "disp": true, "width": "6", "collapse": false }, { "id": "caf553df.0cf3d", "type": "ui_gauge", "z": "db9a4040.e1ba5", "name": "", "group": "a62b049e.7938a8", "order": 0, "width": 0, "height": 0, "gtype": "gage", "title": "gauge", "label": "units", "format": "{{value}}", "min": 0, "max": 10, "colors": [ "#00b500", "#e6e600", "#ca3838" ], "seg1": "", "seg2": "", "x": 300, "y": 260, "wires": [] } ]

@DoTu619
Copy link

DoTu619 commented Dec 27, 2020

I am facing the same. Today I updated dashboard to latest 2.26.0. I use option "Angular theme everywhere".
I had about 6 gauges, every one got same error: "TypeError: Cannot read property 'value' of undefined" and they don't appear on dashboard.
Right after I deploy flows with option "Node-RED theme everywhere" gauges are working (they appear on dashboard).

@dceejay dceejay added the bug label Dec 28, 2020
@dceejay
Copy link
Member

dceejay commented Dec 28, 2020

Excellent test case - it was the angular theme was the missing ingredient...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants