I want to use a third party node which connects to a websocket of an ISY994i. This node requires configuration, however the pencil icon used to open the config panel is missing and I can't figure out why.
No errors of consequence in the startup log. Log is attached just in case…
25 Jun 13:29:19 - [info] Node-RED version: v0.18.7
25 Jun 13:29:19 - [info] Node.js version: v5.2.0
25 Jun 13:29:19 - [info] Darwin 10.8.0 x64 LE
25 Jun 13:29:22 - [info] Loading palette nodes
25 Jun 13:29:43 - [info] Dashboard version 2.8.2 started at /ui
25 Jun 13:29:43 - [warn] ------------------------------------------------------
25 Jun 13:29:43 - [warn] [node-red/rpi-gpio] Info : Ignoring Raspberry Pi specific node
25 Jun 13:29:43 - [warn] [node-red-contrib-isy/isy-controller] SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode (line:1)
25 Jun 13:29:43 - [warn] ------------------------------------------------------
25 Jun 13:29:43 - [info] Settings file : /Users/paul/.node-red/settings.js
25 Jun 13:29:43 - [info] User directory : /Users/paul/.node-red
25 Jun 13:29:43 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
25 Jun 13:29:43 - [info] Flows file : /Users/paul/.node-red/flows_mini.local.json
25 Jun 13:29:44 - [info] Server now running at http://127.0.0.1:1880/
25 Jun 13:29:44 - [warn]
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the ‘credentialSecret’ option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
25 Jun 13:29:44 - [info] Starting flows
25 Jun 13:29:45 - [info] Started flows
25 Jun 13:29:45 - [error] [mysql:WeathercatDB] Database not connected
25 Jun 13:29:45 - [error] [mysql:WeathercatDB] Database not connected
25 Jun 13:29:45 - [info] [mqtt-broker:83cab2d2.393bd] Connected to broker: mqtt://127.0.0.1:1883
25 Jun 13:29:45 - [info] [mqtt-broker:46636c6c.207d1c] Connected to broker: mqtt://127.0.0.1:1883
Yeah, that’s going to be a problem due to my hardware unfortunately. I’m stuck because everything requires a newer OS in order to compile and I can’t upgrade the OS without completely killing the performance of the mac mini because 10.6 is the last OS that supports the Core 2 Duo.
I will do some testing on my laptop and see if I can tie this issue to the nodejs version.
@knolleary Well that’s a relief - I’m really hoping this error isn’t due to my outdated nodejs install since there isn’t anything I can do to fix that besides throw $ at it.
@zenofmud sorry for the confusion - i am definitely running 0.18.7. I had accidentally pasted the startup log from a few weeks back. I edited my post above and put today’s startup log.
@zenofmud That has to be the problem - it would also confirm that my issue is due to my outdated nodejs. The question now is - what version of NodeJS is @knolleary running?
I edited the node-red-contrib-isy/nodes/isy/isy.js and replaced let with var just to see what would happen. It progresses past that error now but fails at this.REST = function (url, successCallback = dummyRESTCallback, errorCallback = dummyRESTCallback) { with SyntaxError: Unexpected token =
I have tested with both node 4 and node 8 - recreates in both. But yes, the node does require a newer node.js version. However the error you’re hitting is in the browser and shouldn’t have anything to do with the version of node.
By all means continuing speculating, but given I can recreate it, I will have a definitive answer for you shortly.
@knolleary, @zenofmud I modified the code by replacing let with var and by removing the inline function declare syntax and replacing with something that is effectively similar but not as elegant. The configure pencil icon now appears in the node.
The ISY WebSocket node’s label function assumes this.controller exists, which it won’t for a newly added node. That is the cause of the stack trace you see in the browser log. But it is completely separate to the lack of the pencil icon.
The ISY Controller node requires node 6 or later. If you’re running on an earlier version then that node won’t get loaded. That means when you edit the websocket node it can’t find the isy-controller type so doesn’t build the usual config node ui with the pencil button etc.