# Node red stopped working after uncaught exception of json token

**URL:** <https://discourse.nodered.org/t/node-red-stopped-working-after-uncaught-exception-of-json-token/39738>\
**Category:** General\
**Created:** [25 January 2021 22:32 UTC](https://discourse.nodered.org/t/node-red-stopped-working-after-uncaught-exception-of-json-token/39738 "2021-01-25T22:32:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mac5562](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mac5562/32/34943_2.png) [@mac5562](https://discourse.nodered.org/u/mac5562)\
**Post date:** [25 January 2021 22:32 UTC](https://discourse.nodered.org/t/node-red-stopped-working-after-uncaught-exception-of-json-token/39738/1 "2021-01-25T22:32:45Z")

</div>

Hi !

I worked on the node red, and suddenly the whole system is crushed. In the node js terminal, i got this error message:

```auto
25 Jan 23:24:00 - [red] Uncaught Exception:
25 Jan 23:24:00 - SyntaxError: Unexpected token i in JSON at position 5061
    at JSON.parse (<anonymous>)
    at NlpManager.import (C:\Users\tamas\.node-red\node_modules\node-nlp\src\nlp\nlp-manager.js:245:51)
    at C:\Users\tamas\.node-red\node_modules\node-red-contrib-chatbot\nodes\chatbot-nlp-load.js:32:23
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)

```

Is there any solutioin of that or reinstall the whole system (which wouldn't be a big problem, because today i made a back up about i) ? Someone know, which json file is contains the error?

Thank you for your helps !

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 January 2021 22:39 UTC](https://discourse.nodered.org/t/node-red-stopped-working-after-uncaught-exception-of-json-token/39738/2 "2021-01-25T22:39:50Z")

</div>

You should report this to the repository of `node-red-contrib-chatbot`. Basically, a node should handle its own errors so as not to crash node-red.

You might also want to switch to using the telegram nodes instead.

> [@mac5562](#):
>
> reinstall the whole system

No need for anything so drastic.

start node-red using safe mode, fix the problem, deploy.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [25 January 2021 22:40 UTC](https://discourse.nodered.org/t/node-red-stopped-working-after-uncaught-exception-of-json-token/39738/3 "2021-01-25T22:40:49Z")

</div>

Yes, JSON parsing is notoriously fickle and should ALWAYS be wrapped in a try/catch.

---

<div class="post-metadata">

**Author:** ![mac5562](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mac5562/32/34943_2.png) [@mac5562](https://discourse.nodered.org/u/mac5562)\
**Post date:** [25 January 2021 23:17 UTC](https://discourse.nodered.org/t/node-red-stopped-working-after-uncaught-exception-of-json-token/39738/4 "2021-01-25T23:17:20Z")

</div>

Okay i fixed the problem in safe mode, thank you for your help.

> [@Steve-Mcl](#):
>
> You might also want to switch to using the telegram nodes instead.

The reason why i use chatbot is because, i want to use fb messenger because that one i use daily.

---

<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:** [8 February 2021 23:17 UTC](https://discourse.nodered.org/t/node-red-stopped-working-after-uncaught-exception-of-json-token/39738/5 "2021-02-08T23:17:59Z")

</div>

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