# Problems after upgrade to v. 2.2

**URL:** <https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417>\
**Category:** General\
**Created:** [28 January 2022 18:57 UTC](https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417 "2022-01-28T18:57:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![demokedes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/demokedes/32/19082_2.png) [@demokedes](https://discourse.nodered.org/u/demokedes)\
**Post date:** [28 January 2022 18:57 UTC](https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417/1 "2022-01-28T18:57:10Z")

</div>

Dear all,  
Till today I was having v.1.3.x and it was working fine. SInce I wanted to have Monaco editor, I upgraded to v.2.2.  
After upgrade everything seems fine. ALso all the flows were working until, I entered into some functions. I didn't change anything, but after deploy, nodes are not deployed any more. I am getting errors, they are not configured correctly.  
Any idea?  
This is very frustrating for me. Can I downgrade it?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [28 January 2022 19:07 UTC](https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417/2 "2022-01-28T19:07:36Z")

</div>

> [@demokedes](#):
>
> nodes are not deployed any more. I am getting errors, they are not configured correctly.

Do you get any red triangles over those nodes .. meaning that they are not configured correctly ?  
What are those nodes and can you expand a little of what errors you get ?  
Maybe a screenshot of the errors can be helpful and if its a Function node that is giving the error .. share the code to check if the syntax is correct. (it could be possible that Monaco is less forgiving on some Javascript syntax errors than Ace - the previous editor)

---

<div class="post-metadata">

**Author:** ![demokedes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/demokedes/32/19082_2.png) [@demokedes](https://discourse.nodered.org/u/demokedes)\
**Post date:** [28 January 2022 19:11 UTC](https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417/3 "2022-01-28T19:11:24Z")

</div>

Aha,  
Yes, I am getting a triangle. I am getting them on Function node.  
The problem is, that I don't know where the error is.  
But I went step by step, And I realized that this piece of code is problematic:

```auto
d = new Date,
dformat = [d.getMonth()+1,
    d.getDate(),
    d.getFullYear()].join('/')+' '+
    [d.getHours(),
    d.getMinutes(),
    d.getSeconds()].join(':');
    dtstmp = new Date().toString();

```

The error is in first line.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [28 January 2022 19:14 UTC](https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417/4 "2022-01-28T19:14:57Z")

</div>

you have to define a new variable with `let` or `var`

```javascript
let d = new Date,
    dformat = [d.getMonth() + 1,
    d.getDate(),
    d.getFullYear()].join('/') + ' ' +
        [d.getHours(),
        d.getMinutes(),
        d.getSeconds()].join(':');

let dtstmp = new Date().toString();

```

> [@demokedes](#):
>
> The error is in first line.

Exactly .. Monaco underlines the error 😉

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/852c29c2b0832b7f798b11bcc395f98046229fed.png)

---

<div class="post-metadata">

**Author:** ![demokedes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/demokedes/32/19082_2.png) [@demokedes](https://discourse.nodered.org/u/demokedes)\
**Post date:** [28 January 2022 19:22 UTC](https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417/5 "2022-01-28T19:22:21Z")

</div>

Aha...you're right.  
I didn't define d as variable. After that, it is working. I had this piece of code in majority of problematic functions. It looks like "ace" ignored that kind of mistakes.  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 January 2022 20:14 UTC](https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417/6 "2022-01-28T20:14:50Z")

</div>

Yes, Monaco is very much more aggressive (correctly so) at spotting coding errors. Truth is that ACE is rather long in the tooth now.

---

<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:** [11 February 2022 20:15 UTC](https://discourse.nodered.org/t/problems-after-upgrade-to-v-2-2/57417/7 "2022-02-11T20:15:41Z")

</div>

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