# Bug with expression editor calculation

**URL:** <https://community.n8n.io/t/bug-with-expression-editor-calculation/17860>\
**Category:** Questions\
**Tags:** expressions\
**Created:** [September 19, 2022, 7:05pm UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860 "2022-09-19T19:05:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [September 19, 2022, 7:05pm UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/1 "2022-09-19T19:05:04Z")

</div>

Hi,

So this workflow has a bug which happens every time.  
As soon as you add the second “_" it crashes. Before then when adding the first "_” it starts to slow down.

https://www.loom.com/embed/4be599002162429b945bbb5d08fd279a

Calculation is done in the SET node.

ps. I reproduced it after another user experienced this issue. That was on an older version (184)

## Information on your n8n setup

- **n8n version:** 194
- **Database you’re using (default: SQLite):** postgres
- **Running n8n with the execution process [own(default), main]:** own
- **Running n8n via [Docker, npm, n8n.cloud, desktop app]:** Docker

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [September 20, 2022, 6:19am UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/2 "2022-09-20T06:19:54Z")

</div>

Hi @BramKn, thanks so much for reporting this!

@Mutasem was looking into cases of the UI slowing down recently, could you perhaps take a look into what might be causing this?

---

<div class="post-metadata">

**Author:** ![Mutasem](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutasem/32/11738_2.png) [@Mutasem](https://community.n8n.io/u/Mutasem)\
**Post date:** [September 20, 2022, 10:34am UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/3 "2022-09-20T10:34:41Z")

</div>

Thanks @MutedJam … Will try to look into it soon

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [September 29, 2022, 7:18pm UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/4 "2022-09-29T19:18:26Z")

</div>

Hi @Mutasem

Any clue what it is causing this?  
Just had it again where I try to divide 2 values coming from a few nodes back. Also heard by PC ramping up and going bonkers on 1 core. (nothing else really running and the timing was perfect)

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/8/3/8390c3b14838729331da2d8ecde607033b22235f.png)

Actually after writing this, I went back to the tab and it started going crazy again on one core. So something is not right with this expression editor in combination with deviding 2 values from nodes before it(referencing the node and then the data not simply json coming in)

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [September 30, 2022, 7:18am UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/5 "2022-09-30T07:18:23Z")

</div>

Hey @BramKn,

Oddly enough this is something I ran into last year when creating a quote tool using n8n, I ended up writing the expressions in a text editor and pasting them in as once in everything works great.

I have not seen any fix for this come in yet but I know @Mutasem has been busy other tasks so it will likely take a bit longer.

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [September 30, 2022, 7:50am UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/6 "2022-09-30T07:50:11Z")

</div>

Hi @Jon

Thanks for the tip, will try that next time.  
The most frustrating thing is when you forget this is an issue and the whole workflow is gone because of course I forget to save. 😅

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [September 30, 2022, 8:10am UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/7 "2022-09-30T08:10:38Z")

</div>

I remember the pain well, I probably should have reported it at the time.

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [September 30, 2022, 8:12am UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/8 "2022-09-30T08:12:05Z")

</div>

you are forgiven. Now work your magic and fix it 😉 🤣

---

<div class="post-metadata">

**Author:** ![Mutasem](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutasem/32/11738_2.png) [@Mutasem](https://community.n8n.io/u/Mutasem)\
**Post date:** [October 7, 2022, 2:44pm UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/9 "2022-10-07T14:44:07Z")

</div>

Looked into this. Seems to be related to how expressions resolve and still unclear to me what the root cause is… But it works with new syntax. You can use that instead.

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [October 7, 2022, 3:52pm UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/10 "2022-10-07T15:52:20Z")

</div>

The new syntax looks good, any docs on that?

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [October 7, 2022, 3:56pm UTC](https://community.n8n.io/t/bug-with-expression-editor-calculation/17860/11 "2022-10-07T15:56:56Z")

</div>

[https://docs.n8n.io/code-examples/methods-variables-examples/node/](https://docs.n8n.io/code-examples/methods-variables-examples/node/)
