# Node Red Uncaught exception

**URL:** https://discourse.nodered.org/t/node-red-uncaught-exception/40769
**Category:** General
**Created:** [10 February 2021 17:39 UTC](https://discourse.nodered.org/t/node-red-uncaught-exception/40769 "2021-02-10T17:39:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)
#### Post date: [10 February 2021 17:39 UTC](https://discourse.nodered.org/t/node-red-uncaught-exception/40769/1 "2021-02-10T17:39:36Z")

</div>

I tried installing the module moment-timezone (activating functionGlobalCOntext in settings.js) but node red crashed upon start. So I removed the module, re-edited settings.js but still I can't start Node Red.

This is the log:

```auto
Feb 10 18:37:17 liliorest Node-RED[17055]: 10 Feb 18:37:17 - [red] Uncaught Exception:
Feb 10 18:37:17 liliorest Node-RED[17055]: 10 Feb 18:37:17 - Api Error: Unexpected response status; 404
Feb 10 18:37:17 liliorest Node-RED[17055]: at requireStatusCode200 (/home/boss/.node-red/node_modules/node-hue-api/hue-api/httpPromise.js:100:15)
Feb 10 18:37:17 liliorest Node-RED[17055]: at _fulfilled (/home/boss/.node-red/node_modules/q/q.js:787:54)
Feb 10 18:37:17 liliorest Node-RED[17055]: at /home/boss/.node-red/node_modules/q/q.js:816:30
Feb 10 18:37:17 liliorest Node-RED[17055]: at Promise.promise.promiseDispatch (/home/boss/.node-red/node_modules/q/q.js:749:13)
Feb 10 18:37:17 liliorest Node-RED[17055]: at /home/boss/.node-red/node_modules/q/q.js:557:44
Feb 10 18:37:17 liliorest Node-RED[17055]: at flush (/home/boss/.node-red/node_modules/q/q.js:108:17)
Feb 10 18:37:17 liliorest Node-RED[17055]: at processTicksAndRejections (internal/process/task_queues.js:79:11)
Feb 10 18:37:17 liliorest systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE
Feb 10 18:37:17 liliorest systemd[1]: nodered.service: Failed with result 'exit-code'.

```

---

<div class="post-metadata">

### Author: ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)
#### Post date: [10 February 2021 17:51 UTC](https://discourse.nodered.org/t/node-red-uncaught-exception/40769/2 "2021-02-10T17:51:37Z")

</div>

From the log it looks like the issue is is node-hue-api. I managed to remove it and it is started again.  
But how can I use moment-timezone?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [10 February 2021 17:53 UTC](https://discourse.nodered.org/t/node-red-uncaught-exception/40769/3 "2021-02-10T17:53:42Z")

</div>

Moment timezone is available in the change node using JSONata.

```auto
[{"id":"dfa49b8c.ee6ff","type":"debug","z":"8d8a515a.78af18","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":460,"y":1340,"wires":[]},{"id":"74bec0ab.4e3b48","type":"inject","z":"8d8a515a.78af18","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$moment($now()).tz(\"London/Euroupe\").format(\"ha Z\")","payloadType":"jsonata","x":160,"y":1340,"wires":[["dfa49b8c.ee6ff"]]}]

```

---

<div class="post-metadata">

### Author: ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)
#### Post date: [10 February 2021 17:54 UTC](https://discourse.nodered.org/t/node-red-uncaught-exception/40769/4 "2021-02-10T17:54:48Z")

</div>

Thank you. I was looking to use it in a function, but I can manage it in a change node!

---

<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 April 2021 17:55 UTC](https://discourse.nodered.org/t/node-red-uncaught-exception/40769/5 "2021-04-11T17:55:21Z")

</div>

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