# Syntax error if only comments in function node On Stop

**URL:** <https://discourse.nodered.org/t/syntax-error-if-only-comments-in-function-node-on-stop/45600>\
**Category:** General\
**Created:** [13 May 2021 15:19 UTC](https://discourse.nodered.org/t/syntax-error-if-only-comments-in-function-node-on-stop/45600 "2021-05-13T15:19:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 May 2021 15:19 UTC](https://discourse.nodered.org/t/syntax-error-if-only-comments-in-function-node-on-stop/45600/1 "2021-05-13T15:19:44Z")

</div>

A minor issue with node-red 1.3.4, if the On Stop tab of a Function node consists of only comments (after the default header text there) then on passing the node a message the error  
`SyntaxError: Unexpected end of input (cleanup:line 17)`  
appears in the debug pane.

To replicate this add a new function node and add just a comment line to the On Stop tab, and feed it with an Inject node.

It may seem that this is a pointless thing to do, but it bit me when I was experimenting with On Stop code and commented it all out as a test. To get the node to run I had to completely delete the On Stop contents.

---

<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:** [13 May 2021 16:24 UTC](https://discourse.nodered.org/t/syntax-error-if-only-comments-in-function-node-on-stop/45600/2 "2021-05-13T16:24:44Z")

</div>

Thanks @Colin

When it's something as reproducible as that, please do go ahead and raise an issue on github if you want.

Although no need this time as I've just pushed the fix.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 May 2021 16:27 UTC](https://discourse.nodered.org/t/syntax-error-if-only-comments-in-function-node-on-stop/45600/3 "2021-05-13T16:27:17Z")

</div>

Great, thanks.

I am never sure when I should report something here and when to just submit an issue.

---

<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:** [12 July 2021 16:28 UTC](https://discourse.nodered.org/t/syntax-error-if-only-comments-in-function-node-on-stop/45600/4 "2021-07-12T16:28:17Z")

</div>

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