# Inject nodes buttons disabled after deploying a node generated from a subflow

**URL:** <https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940>\
**Category:** Developing Nodes\
**Created:** [2 April 2024 13:07 UTC](https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940 "2024-04-02T13:07:30Z")\
**Posts on this page:** 7\
**Page:** 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:** [2 April 2024 13:07 UTC](https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940/1 "2024-04-02T13:07:30Z")

</div>

I have a strange situation I hope someone can help with. I am developing a node using [Packaging a Subflow as a module](https://nodered.org/docs/creating-nodes/subflow-modules). When I place the node on the flow and deploy then in the developer console I see

```auto
VM408:341 
 Uncaught TypeError: Cannot read properties of undefined (reading 'name')
    at <anonymous>:341:118
    at Array.map (<anonymous>)
    at Array.handleDebugMessage (<anonymous>:333:47)
    at i.onmessage (red.min.js?v=5a8f4f4e892d:16:35606)

```

and the buttons on all inject nodes become greyed out. If I move a node and re-deploy then there is no error and the buttons are back to normal.  
If I open the node and edit any property apart from Name and deploy then I see the same situation.  
If I give it a name then the issue goes away, unless I blank the name again, in which case the problem returns.  
I am seeing this in 3.1.6 and 4.0.0 beta 1. Is there something I can do to prevent it or is this a bug?

To see the problem the node can be installed using  
`npm install colinl/node-red-guaranteed-delivery`  
It is called Guaranteed Delivery and appears in the Functions category.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [2 April 2024 13:10 UTC](https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940/2 "2024-04-02T13:10:01Z")

</div>

My best guess from that stacktrace and your description is your subflow is triggering a message in the debug sidebar somehow, but as its a packaged subflow, the editor doesn't know about the nodes inside it so some of the logic around handling messages in the debug sidebar doesn't cope with a node id it cannot lookup.

Please raise an issue.

---

<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:** [2 April 2024 13:16 UTC](https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940/3 "2024-04-02T13:16:59Z")

</div>

> [@knolleary](#):
>
> subflow is triggering a message in the debug sidebar

That makes me realise that I have a node.warn() statement in the OnStart of a function node in the subflow, so perhaps that is it.

---

<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:** [2 April 2024 14:11 UTC](https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940/4 "2024-04-02T14:11:48Z")

</div>

I have confirmed that the problem during deploy is caused by `node.warn()` in the Function node onStart. However I also get the browser error if I use `node.warn()` in the onMessage code, and the warn message does not appear in the debug pane. Does that mean that I just can't use warn() in a packaged subflow, or is it something that can be improved? If so then I will submit an issue.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [2 April 2024 14:42 UTC](https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940/5 "2024-04-02T14:42:12Z")

</div>

It seems reasonable for a subflow module to be able to log to the sidebar and for it to be handled appropriately.

---

<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:** [2 April 2024 15:36 UTC](https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940/6 "2024-04-02T15:36:19Z")

</div>

Issue submitted [Subflows packaged as modules are not able to use node.warn() · Issue #4641 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/4641)

---

<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:** [1 June 2024 15:36 UTC](https://discourse.nodered.org/t/inject-nodes-buttons-disabled-after-deploying-a-node-generated-from-a-subflow/86940/7 "2024-06-01T15:36:21Z")

</div>

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