# Node development: troubleshooting process?

**URL:** <https://discourse.nodered.org/t/node-development-troubleshooting-process/23853>\
**Category:** General\
**Created:** [29 March 2020 20:01 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853 "2020-03-29T20:01:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgshacklett](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bgshacklett/32/18654_2.png) [@bgshacklett](https://discourse.nodered.org/u/bgshacklett)\
**Post date:** [29 March 2020 20:01 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853/1 "2020-03-29T20:01:11Z")

</div>

Hello,

I'm getting started on my first node; I'm basically in the hello world phase right now. I've been running into a ton of different issues with getting the node to load and behave properly. The biggest thing I'm running into is that I'm not seeing any errors, neither in the browser's developer console nor in the console output from the server.

FWIW: the most recent issue I'm having is that I can't get the node's label to update; it doesn't seem to be executing the function for the label more than once on load.

Thanks!

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [29 March 2020 20:12 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853/2 "2020-03-29T20:12:28Z")

</div>

If you are using vscode as your IDE you can use the build in debugger. For client side debugging use the browsers debugger.  
Very powerful tools.

In your case place the `debugger;` statement where the update should happen. But likely it will never trigger. These problems are hard to debug because there is no real error to catch when your code isn’t executed at all.

And BTW welcome to the forum.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 March 2020 20:31 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853/3 "2020-03-29T20:31:53Z")

</div>

the Node's label is not dynamic - it is only set on load.

---

<div class="post-metadata">

**Author:** ![bgshacklett](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bgshacklett/32/18654_2.png) [@bgshacklett](https://discourse.nodered.org/u/bgshacklett)\
**Post date:** [30 March 2020 01:02 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853/4 "2020-03-30T01:02:35Z")

</div>

I was wondering about that for a while, but looking at other nodes, it seems very common to use something like:  
`label: () => this.name || '<node_type>',`

Also, changing the name of some of the default nodes results in their label changing.

---

<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:** [30 March 2020 07:04 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853/5 "2020-03-30T07:04:45Z")

</div>

You cannot use arrow functions if you want to use `this` to reference the node.

You need.to define a proper function:

```auto
label: function () { return this.name || 'node-type' }

```

---

<div class="post-metadata">

**Author:** ![bgshacklett](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bgshacklett/32/18654_2.png) [@bgshacklett](https://discourse.nodered.org/u/bgshacklett)\
**Post date:** [31 March 2020 01:32 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853/6 "2020-03-31T01:32:39Z")

</div>

That was it. Thanks! Is this something intrinsic to Javascript that I've overlooked, or is it specific to Node-Red?

---

<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:** [31 March 2020 07:01 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853/7 "2020-03-31T07:01:55Z")

</div>

It's a feature of JavaScript arrow functions. One of the edge cases when they shouldn't be used.

---

<div class="post-metadata">

**Author:** ![bgshacklett](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bgshacklett/32/18654_2.png) [@bgshacklett](https://discourse.nodered.org/u/bgshacklett)\
**Post date:** [1 April 2020 02:18 UTC](https://discourse.nodered.org/t/node-development-troubleshooting-process/23853/8 "2020-04-01T02:18:38Z")

</div>

Got it. MDN sums it up pretty well here\*:

> An **arrow function expression** is a syntactically compact alternative to a regular [function expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function), although without its own bindings to the `this` , `arguments` , `super` , or `new.target` keywords. Arrow function expressions are ill suited as methods, and they cannot be used as constructors.

Hopefully eslint will spot things like that if I can get it to look inside of the HTML.

\*[Arrow function expressions - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions)
