Error adding flows Cannot read property 'indexOf' of undefined


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:

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

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.


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?

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

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