Configuration pencil icon missing from third party node. How to debug?

#1

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.

I submitted this issue to the developer, but haven't gotten a response yet.

Screenshot (I can't provide a screenshot because new users are only allowed one image per post??)

There is also an error in the browser console:

I'm hoping someone here might be able to shed some light on this or at least confirm that my issue exists for them as well.

I can read/write javascript just fine but I'm having problems figuring out how to debug this particular problem.

#2

Here's the screenshot of the missing config pencil icon

#3

Can you share your node’s HTML - in particular the object you pass to the RED.nodes.registerType function?

#4

@knolleary

EDIT: Here’s the Node’s HTML file:

#5

Are there any errors in the browser’s javascript console when you open your edit dialog?

#6

Yes, I posted a screenshot of the error in my first post: https://imgur.com/uLCzqS1.png

#8

Works fine for me.

what versions of NR and node.js ?
What platform and OS?
any error messages on the NR log at startup?

#9

@zenofmud:

  • NodeJS v 5.2.0

  • Node-Red v 0.18.7

  • Darwin 10.8.0 x64 LE (Mac OSX)

  • 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

#10

nodejs v5 has been end of life for 2 years, it’s time to upgrade

The recommended nodejs version is the current LTS version

#11

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.

#12

@fahrvergnuugen I’ve just installed the ISY node and I get the same error as you when I add the node to the workspace.

So yes, something is broken with the node, but Node-RED ought to be handling it better whatever it is.

#13

@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.

#14

odd because it works fine for me.
osx high sierra - nr 0.18.7 node v8.9.4

#15

you are on NR 0.18.4 according to the log, latest is 0.18.7

#16

@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.

#17

Soooo I wonder if this is part of the problem

#18

@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? :slight_smile:

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 =

My guess is that this syntax was added to nodejs.

#19

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.

#20

@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.

#21

Ah right - there are actually two bugs here.

  1. 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.

  2. 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.