zwave-js / node-red-contrib-zwave-js

The most powerful, high performing and highly polished Z-Wave node for Node-RED based on Z-Wave JS. If you want a fully featured Z-Wave framework in your Node-RED instance, you have found it.
MIT License
47 stars 6 forks source link

TypeError: _Context.input is not a function #78

Closed 0rsa closed 3 years ago

0rsa commented 3 years ago

Plugin Version 4.0.0

Platform Debian 10

Describe the bug Z-wave control panel is empty

To Reproduce Open Z-wave Panel and click on "Refresh node list"

Debug Logs

TypeError: _Context.input is not a function
    at node_modules/node-red-contrib-zwave-js/zwave-js/ui/server.js:108:16
    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at /usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:275:10)
    at expressInit (/usr/lib/node_modules/node-red/node_modules/express/lib/middleware/init.js:40:5)
    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:317:13)
    at /usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/index.js:275:10)
    at query (/usr/lib/node_modules/node-red/node_modules/express/lib/middleware/query.js:45:5)
    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)

Node-red 1.3.5 NodeJS 14.17.2

marcus-j-davies commented 3 years ago

Hi, has the driver loaded? You get this if you open the UI before things have managed to init. What happens when you refresh the browser page?

0rsa commented 3 years ago

It was probably an init error, you are right.

This is now working. I don't know if a browser restart or a node red restart solved issue, I did both. Currently migrating from zme uzb1 to z-stick 7 and from your old 3.8.0 to 4.0.0, I had 2 instances of node-red-contrib-zwave-js launched with 2 different instances of node-red, I suppose that it does not help for a good startup.

I close this issue as this is resolved for me. Feel free to re open if you can improve first init to avoid this error.

Thank you very much for your quickly replies.

marcus-j-davies commented 3 years ago

It's an edge case, but I probably need to improve it still - it only occurs if the UI/NR is trying to query things when its being initialised - refreshing the page usually resolves it.

Remember to transition to the new API, the old message format is being removed. https://github.com/zwave-js/node-red-contrib-zwave-js/blob/main/APIChange.md

Thank you

0rsa commented 3 years ago

Yes, thank you for your guide, this is really appreciated. This is my planned work for now :)

marcus-j-davies commented 3 years ago

You welcome.

Please raise a Help Wanted request, if you get stuck (And enjoy the map)