You have updated the HA App for Node-RED, and the difference between 21.0.1 and 21.0.3 has few changes but does move Node-RED itself from 4.1.5 to 4.1.6.
The 4.1.6 release of Node-RED does not appear to have any significant changes, and nothing that appears to modify the run-time.
There are a lot of nodes available for Node-RED. The NR standard package for the editor/runtime includes the core nodes, which are part of each NR release. The HA App bundle adds in a few extra nodes. After that, you can add anything from the NR node library. Most of these are ‘contib’ nodes, or contributions from the community. Written by anyone, they are mostly written, supported for a bit, then abandoned. Beyond that, any changes long-term to Node-RED, or Node.JS on which NR runs, or to Home Assistant, or to the environment generally, may cause the node to fail. There are thousands of extra ‘contribution’ nodes, and no one is going to test any of these at every update to Node-RED or to the HA Node-RED App.
This node does not appear in the standard NR package, nor the HA App. It is also no longer supported, and has a big red-text warning in the GitHub repository. Therefore, any issues with this node are very much a case of ‘sort it out yourself’.
The error message you are seeing points directly to the source file at line 239, character 31, so easy enough to locate the GitHub repository, the code, and the offending part.
function discoverIpAddresses(serviceType, discoveryCallback) {
var ipaddresses = [];
var bonjour = require('bonjour')();
var browser = bonjour.find({
type: serviceType
}, function (service) {
service.addresses.forEach(function (element) {
if (element.split(".").length == 4) {
const deviceTypeName = ""
+ service.txt.md
+ (service.txt.md.toLowerCase() != service.txt.fn.toLowerCase() ? "." + service.txt.fn : "");
const label = deviceTypeName
+ " (" + element + ")";
ipaddresses.push({
label: label,
device: deviceTypeName,
value: element
});
}
});
//Add a bit of delay for all services to be discovered
if (discoveryCallback)
setTimeout(function () {
discoveryCallback(ipaddresses);
}, 2000);
});
}
I am certainly no expert in such code, but clearly the line
+ (service.txt.md.toLowerCase() != service.txt.fn.toLowerCase()
is failing where the method .toLowerCase() is being applied to the return from a bonjour call.
My guess is that this code is part of the node’s startup routine, where it uses bonjour to find services. The fact that this is run at startup, when the node first loads, probably means that Node-RED cannot load the node correctly, and hence Node-RED will fail to start. I think that your only immediate solution is to remove this node from the palette.
Interestingly, the bonjour JS code (loaded using ‘require’) was updated only two weeks ago from 3.5.0 (May 2016) to 3.5.1, so it might be possible that a change there has resulted in a different or null return from the API find call.
I note too that bonjour (js) was effectively replaced by bonjour-services, so this is an old node using an old library.
As Wally says - if the bonjour find returns nothing, then the code .lowercase will fail, and my assumption is that better code would have a ‘try’ and some form of error recovery…
Since HA has tts services using eg. cloud or google, I use Action tts.cloud targeted to my google device. You can therefore use an HA Action node to perform the required task in place of this node.