# Deprecated API warning - Can't Identify Source

**URL:** <https://discourse.nodered.org/t/deprecated-api-warning-cant-identify-source/81772>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [4 October 2023 15:38 UTC](https://discourse.nodered.org/t/deprecated-api-warning-cant-identify-source/81772 "2023-10-04T15:38:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![at4lkn4drt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/at4lkn4drt/32/83435_2.png) [@at4lkn4drt](https://discourse.nodered.org/u/at4lkn4drt)\
**Post date:** [4 October 2023 15:38 UTC](https://discourse.nodered.org/t/deprecated-api-warning-cant-identify-source/81772/1 "2023-10-04T15:38:10Z")

</div>

Greetings...

I just updated my Node-Red Addon in Home Assistant to 14.5.0 (Latest update prompt as of 10/2/23). The change log states: "Ships with Node-RED v3.1". I am now getting an error that I can't seem to identify the source. Perhaps I'm glossing over it, but the error message doesn't point to a Node name/ID.

The error references Node-Red 4.0, which I find interesting because both the Home Assistant Addon and the Node-Red hamburger dropdown in the right hand corner both state version 3.1. So I don't quite understand the Deprecated API reference to v4.0.

The error does reference `node-red-contrib-home-assistant-websocket`. If this is related to the Home Assistant Websocket, what is the reference to the deprecated API in v4.0 requiring a CallBack when I'm not running 4.0 but rather v3.1?

Thank you all very much

td

```auto
"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."

```

```auto
Error: 
    at Object.evaluateJSONataExpression (/opt/node_modules/@node-red/util/lib/util.js:775:18)
    at JSONataService.evaluate (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/common/services/JSONataService.js:58:39)
    at TypedInputService.getValue (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/common/services/TypedInputService.js:58:85)
    at EventsAll.getTypedInputValue (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:134:39)
    at /opt/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:138:32
    at Array.forEach (<anonymous>)
    at EventsAll.setCustomOutputs (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:137:20)
    at EventsAll.onHaEventsAll (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/events-all/controller.js:57:18)
    at EventEmitter.<anonymous> (/opt/node_modules/node-red-contrib-home-assistant-websocket/di...

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [4 October 2023 15:43 UTC](https://discourse.nodered.org/t/deprecated-api-warning-cant-identify-source/81772/2 "2023-10-04T15:43:41Z")

</div>

It is a warning and clearly states, as of node red 4.0 `RED.util.evaluateJSONataExpression` will require a callback.

You can ignore it till node-red 4 is released, as of then if HA has not updated the node to use async with a call back your HA nodes that use the RED.util function will stop working.

If I was you I would raise this with the HA node Athor/s.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 October 2023 15:45 UTC](https://discourse.nodered.org/t/deprecated-api-warning-cant-identify-source/81772/3 "2023-10-04T15:45:15Z")

</div>

There are several threads: [Search results for 'Deprecated evaluateJSONataExpression ' - Node-RED Forum](https://discourse.nodered.org/search?q=Deprecated%20evaluateJSONataExpression%20)

As far as I know, HA have been informed.

Quick search on google for `"HA depreciated evaluateJSONataExpression"` reveals:

> <https://github.com/zachowj/node-red-contrib-home-assistant-websocket/issues/898#issuecomment-1734400849>
>
> \### Describe the bug
> 
> Just upgraded to node red 3.1.0-beta.2 but greeted with th…e following
> \`\`\`
> \[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.
> \[warn\] Error
> at Object.evaluateJSONataExpression (/home/pi/.node-red/node\_modules/@node-red/util/lib/util.js:777:18)
> at JSONataService.evaluate (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/common/services/JSONataService.js:58:39)
> at TypedInputService.getValue (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/common/services/TypedInputService.js:58:85)
> at EventsAll.getTypedInputValue (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:134:39)
> at /home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:138:32
> at Array.forEach (\<anonymous\>)
> at EventsAll.setCustomOutputs (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/nodes/BaseNode.js:137:20)
> at EventsAll.onHaEventsAll (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/nodes/events-all/controller.js:57:18)
> at EventEmitter.\<anonymous\> (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/nodes/EventsNode.js:39:17)
> at EventEmitter.emit (node:events:525:35)
> at Websocket.\_Websocket\_emitEvent (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/homeAssistant/Websocket.js:394:67)
> at Websocket.onClientEvents (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/homeAssistant/Websocket.js:238:87)
> at Object.callback (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/dist/homeAssistant/Websocket.js:143:65)
> at /home/pi/.node-red/node\_modules/home-assistant-js-websocket/dist/haws.cjs:236:34
> at Array.forEach (\<anonymous\>)
> at Connection.\_handleMessage (/home/pi/.node-red/node\_modules/home-assistant-js-websocket/dist/haws.cjs:231:26)
> at callListener (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/node\_modules/ws/lib/event-target.js:290:14)
> at WebSocket.onMessage (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/node\_modules/ws/lib/event-target.js:209:9)
> at WebSocket.emit (node:events:513:28)
> at Receiver.receiverOnMessage (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/node\_modules/ws/lib/websocket.js:1184:20)
> at Receiver.emit (node:events:513:28)
> at Receiver.dataMessage (/home/pi/.node-red/node\_modules/node-red-contrib-home-assistant-websocket/node\_modules/ws/lib/receiver.js:541:14)
> 
> \`\`\`
> 
> \### To Reproduce
> 
> upgraded node-red by \` npm install node-red@next\`
> 
> 
> \### Expected behavior
> 
> \_No response\_
> 
> \### Screenshots
> 
> \_No response\_
> 
> \### Example Flow
> 
> \_No response\_
> 
> \### This package's version (not the Home Assistant add-on version)
> 
> 0.49
> 
> \### Is Node-RED running in Docker?
> 
> No
> 
> \### Node-RED version
> 
> 3.1.0-beta.2
> 
> \### Node.js version
> 
> 18.15.0
> 
> \### Additional context
> 
> \_No response\_

> <https://github.com/zachowj/node-red-contrib-home-assistant-websocket/pull/1063>
>
> This fixes the deprecated warning for evaluateJSONataExpression
> 
> Fixes #898

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 December 2023 15:46 UTC](https://discourse.nodered.org/t/deprecated-api-warning-cant-identify-source/81772/4 "2023-12-03T15:46:14Z")

</div>

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