# Error adding flows Cannot read property 'indexOf' of undefined

**URL:** <https://discourse.nodered.org/t/error-adding-flows-cannot-read-property-indexof-of-undefined/46776>\
**Category:** General\
**Created:** [6 June 2021 14:14 UTC](https://discourse.nodered.org/t/error-adding-flows-cannot-read-property-indexof-of-undefined/46776 "2021-06-06T14:14:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![levi](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@levi](https://discourse.nodered.org/u/levi)\
**Post date:** [6 June 2021 14:14 UTC](https://discourse.nodered.org/t/error-adding-flows-cannot-read-property-indexof-of-undefined/46776/1 "2021-06-06T14:14:26Z")

</div>

Hello,

I was working on node-red, then one minute later when I closed and ran it again from cmd it started to give this error: "Error adding flows Cannot read property 'indexOf' of undefined"

There is no error in cmd. But this what it says in the console of the browser:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/13e56d8e257a22c0690f68df47ac4104c4ba5135.png)

So the Node-RED itself is running (for example the app I created in dashboard is still working) but it does not load the flows on the Node-RED interface anymore.

Node-RED version: v1.2.7  
Node.js version: v14.15.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:** [6 June 2021 14:42 UTC](https://discourse.nodered.org/t/error-adding-flows-cannot-read-property-indexof-of-undefined/46776/2 "2021-06-06T14:42:00Z")

</div>

What were you doing before it failed?

In your .node-red folder you will find the flows file, usually called `flows_something.json`. You should also find the file from before the last deploy, called `.flows_something.json.bak`. Rename the flows file to something else and copy the backup file to the original flows file name. Then restart node-red. That should put you back to the flows before the last deploy. If that doesn't fix it then post the full startup log here. Also tell us what hardware/os you are running on.

---

<div class="post-metadata">

**Author:** ![levi](https://avatars.discourse-cdn.com/v4/letter/l/ce73a5/32.png) [@levi](https://discourse.nodered.org/u/levi)\
**Post date:** [7 June 2021 15:16 UTC](https://discourse.nodered.org/t/error-adding-flows-cannot-read-property-indexof-of-undefined/46776/3 "2021-06-07T15:16:05Z")

</div>

Hi!

I am running on a windows 10 os laptop.

I made some investigations and it seems that what caused it were my custom nodes. After I put the same custom node on the flow twice it shows that error. Or after I put another different custom node.

Do you have any idea of what I might have done wrong on my custom nodes?

---

<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:** [7 June 2021 15:54 UTC](https://discourse.nodered.org/t/error-adding-flows-cannot-read-property-indexof-of-undefined/46776/4 "2021-06-07T15:54:16Z")

</div>

I don't but if you provide the github link to your node then I expect someone will take a look.

---

<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:** [6 August 2021 15:54 UTC](https://discourse.nodered.org/t/error-adding-flows-cannot-read-property-indexof-of-undefined/46776/5 "2021-08-06T15:54:48Z")

</div>

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