rdmtc / node-red-contrib-sun-position

This is a ultimate Node-Red Timer, Sun, Moon and Blind flow control.
Apache License 2.0
105 stars 24 forks source link

Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback #537

Open mbbert opened 9 months ago

mbbert commented 9 months ago

Describe the bug After the upgrade to Node-RED 3.1.0 the the debug window and log files are constantly flooded with this warning.

24 Sep 13:51:19 - [warn] Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback. This will not be optional in Node-RED 4.0. Please identify the node from the following stack and check for an update on npm. If none is available, please notify the node author.
24 Sep 13:51:19 - [warn] Error
    at Object.evaluateJSONataExpression (/usr/src/node-red/node_modules/@node-red/util/lib/util.js:775:18)
    at positionConfigurationNode.getPropValue (/data/node_modules/node-red-contrib-sun-position/nodes/position-config.js:1228:39)
    at positionConfigurationNode.getOutDataProp (/data/node_modules/node-red-contrib-sun-position/nodes/position-config.js:762:25)
    at timeCompNode._inputCallback (/data/node_modules/node-red-contrib-sun-position/nodes/time-comp.js:158:57)
    at /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
    at Object.trigger (/usr/src/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
    at timeCompNode.Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
    at timeCompNode.Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
    at timeCompNode.Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:494:10)
    at deliverMessageToDestination (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:799:40)
    at Immediate._onImmediate (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:815:21)
    at processImmediate (node:internal/timers:466:21)

Expected behavior The deprecated API call should be replaced so that these warnings are no longer logged.

System information (please complete the following information):

Additional context I'm using version 2.1.1 of this node, but I'm confident that this isn't solved yet with version 2.2.0-beta3.

I'd would be happy to patch version 2.1.1 myself locally if somebody would help me with code for a work-around. Currently I removed the deprecation warning from util.js. I wasn't able to wrap my head around the callback/Promise/async thing :(

jonferreira commented 1 month ago

Just updated node-red and facing the same issue?

Risked it by updating to 2.2.0-beta3 but still the same.

Is this node still being maintained though as it seems to be stalled? :(

jonferreira commented 1 month ago

for what is worth, #549 fixes it