# 🎉 Node-RED 4.0.0-beta.1 released

**URL:** <https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433>\
**Category:** News\
**Created:** [14 March 2024 17:26 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433 "2024-03-14T17:26:17Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![m-schaeffler](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/m-schaeffler/32/55123_2.png) [@m-schaeffler](https://discourse.nodered.org/u/m-schaeffler)\
**Post date:** [2 April 2024 06:14 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/21 "2024-04-02T06:14:27Z")

</div>

I found a regression in the beta1: [V4.0.0-beta1: change to bool no longer working · Issue #4638 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/4638)

The change node converts everything to bool, if just two values should be changed to bool.  
 ![2024-04-02 08_13_51-Node-RED _ Flow 2 – Mozilla Firefox](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/0240ba0d46952f6c5437b6194d143a932b27d4af.png)

---

<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 07:24 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/22 "2024-04-02T07:24:03Z")

</div>

It might be helpful if you built a small flow (Inject -\> Switch -\> Debug) showing the problem, to make sure we understand fully.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [2 April 2024 07:30 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/23 "2024-04-02T07:30:30Z")

</div>

> [@Colin](#):
>
> (Inject -\> Switch -\> Debug)

I think you meant `(Inject -> Change -> Debug)` As the issue is with a Change node.

---

<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 07:53 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/24 "2024-04-02T07:53:07Z")

</div>

> [@E1cid](#):
>
> I think you meant `(Inject -> Change -> Debug)`

Indeed I did.

---

<div class="post-metadata">

**Author:** ![m-schaeffler](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/m-schaeffler/32/55123_2.png) [@m-schaeffler](https://discourse.nodered.org/u/m-schaeffler)\
**Post date:** [2 April 2024 09:03 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/25 "2024-04-02T09:03:42Z")

</div>

@Colin  
You can find the details in the GitHub issue: [V4.0.0-beta1: change to bool no longer working · Issue #4638 · node-red/node-red · GitHub](https://github.com/node-red/node-red/issues/4638)  
Here is the flow:

```auto
[{"id":"7b945e577024a009","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"ba5a22cdbcc2fcd7","type":"junction","z":"7b945e577024a009","x":340,"y":220,"wires":[["e7d937c74c016290","388cbdbfbc84b326","51821dcea7a40f23"]]},{"id":"e7d937c74c016290","type":"change","z":"7b945e577024a009","name":"to bool","rules":[{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"},{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":220,"wires":[["c6c155046e530222"]]},{"id":"b95a1eacb7e8dca5","type":"inject","z":"7b945e577024a009","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"on","payload":"on","payloadType":"str","x":230,"y":180,"wires":[["ba5a22cdbcc2fcd7"]]},{"id":"034b2af45fdfdef3","type":"inject","z":"7b945e577024a009","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"off","payload":"off","payloadType":"str","x":230,"y":220,"wires":[["ba5a22cdbcc2fcd7"]]},{"id":"e12db9eb3e02fbce","type":"inject","z":"7b945e577024a009","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"error","payload":"error","payloadType":"str","x":220,"y":260,"wires":[["ba5a22cdbcc2fcd7"]]},{"id":"388cbdbfbc84b326","type":"debug","z":"7b945e577024a009","name":"debug 11","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":440,"y":260,"wires":[]},{"id":"c6c155046e530222","type":"debug","z":"7b945e577024a009","name":"debug 12","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":620,"y":220,"wires":[]},{"id":"51821dcea7a40f23","type":"change","z":"7b945e577024a009","name":"to number","rules":[{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":180,"wires":[["0a02112ec5e7e162"]]},{"id":"0a02112ec5e7e162","type":"debug","z":"7b945e577024a009","name":"debug 13","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":620,"y":180,"wires":[]}]

```

---

<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 09:08 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/26 "2024-04-02T09:08:57Z")

</div>

(Have commented on the issue, but adding here for context)

This change was made in response to [#4372](https://github.com/node-red/node-red/issues/4372)

At first read of this and the other issue, it sounds like two different desired behaviours - one saying it should always result in a boolean result, one saying it should only set a boolean in some circumstances.

Will look at the finer details to see if there's a subtly in behaviour we're missing - possibly the fix for the other issue is being too strict.

---

<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 09:11 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/27 "2024-04-02T09:11:56Z")

</div>

> [@Colin](#):
>
> There seems to be a problem with the command `node-red -u` under some circumstances.

@Colin I don't _think_ this is a new behaviour.

I am assuming your settings.js file has the `flowFile` setting set to `flows.json`.

As that is a relative file path, Node-RED will first look in the current working directory for the file. If it is not found, it will then look in the user directory.

So when you run in `~`, it fails to find `flows.json` in `~`, so then looks under `~/.node-red-1884` and finds it

When you run in `~/.node-red` it finds `flows.json` in that directory so uses that.

---

<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 09:39 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/28 "2024-04-02T09:39:01Z")

</div>

> [@knolleary](#):
>
> > [@Colin](#):
> >
> > There seems to be a problem with the command `node-red -u` under some circumstances.
> 
> @Colin I don't _think_ this is a new behaviour.

Yes, you are right. The reason my test with an older version of NR was that its flow file was flows\_.json, so flows.json did not exist in the current dir. So it has apparently always been like that. Whether this is desirable behaviour or not I don't know, but it isn't a v4 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 19:03 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/29 "2024-04-02T19:03:28Z")

</div>

> [@Colin](#):
>
> Subflow packaging as a module appears to be broken if the subflow includes a D2 ui-group config node as a subflow property.

Fix identified - [Fix handling of subflow config-node select type in sf module by knolleary · Pull Request #4643 · node-red/node-red · GitHub](https://github.com/node-red/node-red/pull/4643)

---

<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:** [5 April 2024 15:19 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/30 "2024-04-05T15:19:48Z")

</div>

> [@knolleary](#):
>
> Fix identified

Sadly this doesn't seem to have helped, assuming I don't need to repackage the subflow. With NR 4.0.0 Beta.2, after installing `colinl/node-red-dropdown-cdl`, restarting node-red and refreshing the browser, if I place the node on the flow and open it I get

```auto
bootstrap-autofill-overlay.js:4710 
 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'previousSibling')
    at CollectAutofillContentService.recursivelyGetTextFromPreviousSiblings (bootstrap-autofill-overlay.js:4710:30)
    at CollectAutofillContentService.createAutofillFieldLeftLabel (bootstrap-autofill-overlay.js:4603:39)
    at CollectAutofillContentService.<anonymous> (bootstrap-autofill-overlay.js:4174:40)
    at Generator.next (<anonymous>)
    at fulfilled (bootstrap-autofill-overlay.js:4104:58)

```

It looks ok in the editor, but if I select the group, Deploy, and re-open then it appears not to have saved the group. In fact if I export it then I see this, with an empty value for the selected group.

```auto
[
    {
        "id": "16e16813cf41e25f",
        "type": "dropdown-cdl",
        "z": "eff7ca5fd9394ba5",
        "name": "DROPDOWN CDL",
        "Group": {
            "type": {
                "type": "ui-group",
                "value": ""
            },
            "value": "411b8fe1ec44dbe2"
        },
        "label": "Select",
        "options": {
            "type": "json",
            "value": "[\"A\", \"B\"]"
        },
        "topic": "",
        "waitingColour": "red-lighten-5",
        "x": 230,
        "y": 2820,
        "wires": [
            []
        ]
    }
]

```

---

<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:** [5 April 2024 15:23 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/31 "2024-04-05T15:23:13Z")

</div>

@Colin okay - will take another look. It was certainly hitting the same error you were with my test subflow module and confirmed the fix resolved it for my module.

That stack is curious - not sure where `bootstrap-autofill-overlay` is coming from.

---

<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:** [5 April 2024 16:06 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/32 "2024-04-05T16:06:05Z")

</div>

The bootstrap-autofill error appears a couple of seconds after the node edit dialog appears, if that is of any help.

I have tried with a much simpler subflow, with just an ui-text node, and it shows the same behaviour. If you put your test module somewhere I could give it a go, which might tell us something.

---

<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 April 2024 08:37 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/33 "2024-04-06T08:37:58Z")

</div>

Sorry, I misinterpreted what I am seeing. It is in fact correctly saving the group (I was looking at Group,type.value instead of Group.value). The issue here is that when I re-open the node it is not recognising the fact that a group has been configured, and is showing the default group again. It still doesn't appear in the dashboard panel though. It does appear in the dashboard.

---

<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:** [5 June 2024 08:38 UTC](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433/34 "2024-06-05T08:38:51Z")

</div>

Closed on 5 June 2024 08:38 UTC

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

[Previous page](https://discourse.nodered.org/t/node-red-4-0-0-beta-1-released/86433.md?page=1)
