# Cannot read properties of null (reading 'allNodes')

**URL:** <https://discourse.nodered.org/t/cannot-read-properties-of-null-reading-allnodes/63711>\
**Category:** General\
**Created:** [10 June 2022 09:38 UTC](https://discourse.nodered.org/t/cannot-read-properties-of-null-reading-allnodes/63711 "2022-06-10T09:38:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![atmar](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@atmar](https://discourse.nodered.org/u/atmar)\
**Post date:** [10 June 2022 09:38 UTC](https://discourse.nodered.org/t/cannot-read-properties-of-null-reading-allnodes/63711/1 "2022-06-10T09:38:48Z")

</div>

`I have imported "node-red" , initialized it and then used below addFlow function,`

`RED.start().then(() => {`  
`RED.runtime.flows.addFlow({ flow: Flow, req: {} });`  
`});`

still it is throwing error as,

`if (activeFlowConfig.allNodes[node.id]) {`  
`^`  
`TypeError: Cannot read properties of null (reading 'allNodes')`

Can you please help on this to resolve the issue?

---

<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:** [9 August 2022 09:39 UTC](https://discourse.nodered.org/t/cannot-read-properties-of-null-reading-allnodes/63711/2 "2022-08-09T09:39:09Z")

</div>

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