caseyjhol / node-red-contrib-tplink

A collection of Node-RED nodes for TP-Link Smart Home devices
https://www.npmjs.com/package/node-red-contrib-tplink-iot
MIT License
16 stars 15 forks source link

Unexpected Node Error in node-red #58

Closed Steve-Mcl closed 1 year ago

Steve-Mcl commented 2 years ago

Describe the bug Your code uses node.error in the promise .catch (see here) which is causing Node instance to be globalThis and therefore the prototype doesnt contain expected objects and logging capabilities etc.

See issue thread for full details https://github.com/node-red/node-red/issues/3389

To Reproduce Steps to reproduce the behavior: See issue thread for full details https://github.com/node-red/node-red/issues/3389#issuecomment-1040139419 (this comment includes a potential fix)

Expected behavior Node instance to be a node-red node instance (not globalThis)

Screenshots See issue thread for full details https://github.com/node-red/node-red/issues/3389

Desktop (please complete the following information):

caseyjhol commented 1 year ago

Resolved in v1.0.1