# PSA: JSONata V2, Breaking changes

**URL:** <https://discourse.nodered.org/t/psa-jsonata-v2-breaking-changes/75185>\
**Category:** General\
**Tags:** function-node, jsonata\
**Created:** [14 February 2023 15:37 UTC](https://discourse.nodered.org/t/psa-jsonata-v2-breaking-changes/75185 "2023-02-14T15:37:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [14 February 2023 15:37 UTC](https://discourse.nodered.org/t/psa-jsonata-v2-breaking-changes/75185/1 "2023-02-14T15:37:22Z")

</div>

For those that use the `JSONata` package directly in `function` nodes (as I do)  
There is a breaking change that i learned of the hard way

> Version 2.0.0 contains a breaking change to the Javascript API as a result of reimplementing the evaluator to use async functions instead of generators. This provides a performance boost. No breaking changes have been made to the JSONata language itself.

So, this

```auto
jsonata("<some expression>").evaluate({});

```

Now needs to be this

```auto
await jsonata("<some expression>").evaluate({});

```

or

```auto
jsonata("<some expression>").evaluate({}).then((result) => {
   // do something with result
})

```

depending on your setup of course.

---

<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:** [15 April 2023 15:38 UTC](https://discourse.nodered.org/t/psa-jsonata-v2-breaking-changes/75185/2 "2023-04-15T15:38:14Z")

</div>

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