Node-red-mcu-plugin error when reinstalling

After reinstalling node-red and @ralphwetzel/node-red-mcu-plugin, I've encountered these issues:
1: After first start of node-red this error came, see pic01
2: I removed the =, and tried again.
3: After second start of node-red this error came, see pic02
4: I removed the =, and tried again.
5: After the third start everything was normal.
But it didn't install @moddable-node-red, shouldn't it anymore?

When I tried a previous flow which worked before fresh install, this error comes, see pic03.

How do I proceed?

I don't think ??= works with nodejs 14. Upgrade to 18 and it should be ok.
14 is out of support in a months time anyway.

You're facing this issue - as @Colin stated - due to the node.js version you're using.
??= is only supported by node.js >= v15.0.0 ... a fact that I tend to ignore continuously. Sorry for that.

By removing the = you yet change the code significantly ... thus it breaks with the error you see in pic#03.

I'll provide a fix for that later today ... so it should work again with your environment.
Sorry for the inconvenience...


I've published a v1.3.1 of the plugin - which should be visible in the Node-RED "Manage Pallette" sidebar option in a few minutes.
In this version, the two issues you found are reverted to a syntax that Node.js v14 understands.

In the meantime I have updated to node 18 now. My simple program with a switch and an LED seems a bit sluggish.
When I press it, sometimes it responds immediately, and other times after some time.

If you want, you may post the flow data here & we'll check if we can support...

[{"id":"d9a245d0e497656f","type":"tab","label":"mcuPicoW","disabled":false,"info":"","env":[],"_mcu":{"mcu":true}},{"id":"dfe6ab2a51eadbe3","type":"mcu_digital_out","z":"d9a245d0e497656f","name":"Led intern","pin":"32","mode":"Output","initial":"undefined","invert":false,"_mcu":{"mcu":true},"x":690,"y":320,"wires":[]},{"id":"1ba0c84fb0b955e8","type":"comment","z":"d9a245d0e497656f","name":"RPI PicoW","info":"","_mcu":{"mcu":true},"x":430,"y":160,"wires":[]},{"id":"edf91f47eec298d2","type":"mcu_digital_out","z":"d9a245d0e497656f","name":"aRelæ","pin":"26","mode":"Output","initial":"1","_mcu":{"mcu":true},"x":700,"y":200,"wires":[]},{"id":"a935b95bf957dd0b","type":"mcu_digital_out","z":"d9a245d0e497656f","name":"bRelæ","pin":"27","mode":"Output","initial":"1","_mcu":{"mcu":true},"x":700,"y":260,"wires":[]},{"id":"07dcd8fa76ab184e","type":"function","z":"d9a245d0e497656f","name":"Togur","func":"let msg3 = {}\n\nlet invar = msg.payload\n\nif(invar == 0) {\n    msg3.payload = 1\n    node.send([null, null, msg3])\n    //setTimeout(() => {\n    //    msg3.payload = 0\n    //    node.send([null, null, msg3])\n    //},200)\n} else {\n        msg3.payload = 0\n        node.send([null, null, msg3])\n}\n","outputs":3,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\n\nlet msg1 = {}\nlet msg2 = {}\n\nsetInterval(() => {\n    let me = context.get('me') ?? 1\n    \n    if (me) {\n        msg1.payload = 1\n        node.send(msg1)\n        setTimeout(() => {\n            msg1.payload = 0\n            node.send(msg1)\n        }, 200)\n    } else {\n        msg2.payload = 1\n        node.send([null, msg2])\n        setTimeout(() => {\n            msg2.payload = 0\n            node.send([null, msg2])\n        }, 200)\n    }\n\n    me = me ^ 1\n    context.set('me', me)\n}, 5000)\n","finalize":"","libs":[],"_mcu":{"mcu":true},"x":430,"y":260,"wires":[["edf91f47eec298d2"],["a935b95bf957dd0b"],["dfe6ab2a51eadbe3"]]},{"id":"cdff39dbe8d5e1e2","type":"mcu_digital_in","z":"d9a245d0e497656f","name":"Push","pin":"1","mode":"InputPullUp","edge":"1","debounce":"10","initial":true,"_mcu":{"mcu":true},"x":190,"y":260,"wires":[["07dcd8fa76ab184e"]]},{"id":"9e3a7bd8f2970ddb","type":"comment","z":"d9a245d0e497656f","name":"Aktiv lav","info":"","_mcu":{"mcu":true},"x":200,"y":220,"wires":[]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.