# Function node issues: Invalid Properties - noerr (Chrome) & closing editor while in Setup or Close tab

**URL:** <https://discourse.nodered.org/t/function-node-issues-invalid-properties-noerr-chrome-closing-editor-while-in-setup-or-close-tab/33128>\
**Category:** Dashboard\
**Created:** [20 September 2020 21:02 UTC](https://discourse.nodered.org/t/function-node-issues-invalid-properties-noerr-chrome-closing-editor-while-in-setup-or-close-tab/33128 "2020-09-20T21:02:38Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [24 September 2020 09:02 UTC](https://discourse.nodered.org/t/function-node-issues-invalid-properties-noerr-chrome-closing-editor-while-in-setup-or-close-tab/33128/8 "2020-09-24T09:02:00Z")

</div>

> [@Colin](#):
>
> Does the new one show an error in the editor for the missing brace?

Ah good point. No it doesn't - but that's an issue with us, not ACE.

Because the code you put inside the Function node is actually the body of an async function, before we pass it up to ACE to validate, we wrap it in a function:

So when you have the following in the edit box:

```auto
if( msg.topic === 'start' ) {
    node.warn('starting...');

return msg;

```

We actually pass this to ACE to validate:

```auto
async function __nodered__ (msg) {
   if( msg.topic === 'start' ) {
       node.warn('starting...');

   return msg;
}

```

This stops it warning if you use `await` in your function code.

However, it means in the case you've highlighted, it considers the bracket for the `if` statement to have a closing bracket (the one we add), and the bracket that isn't closed is actually on the first line. That puts the warning on the first line and we hide it because it's out of range of _your_ code.

That doesn't stop the count of errors to be correct (`noerrs` === `number of errors`) - which is why the node is (correctly) marked as invalid, despite nothing showing in the edit dialog.

So need to be a bit smarter about handling errors that get flagged on the first (added) line.

---

_[View the full topic](https://discourse.nodered.org/t/function-node-issues-invalid-properties-noerr-chrome-closing-editor-while-in-setup-or-close-tab/33128)._
