I'm using this node to play audio on some of my cast enabled devices and although it functions, each time the node is called, node-red crashes with an error mentioning the node.error call telling me it's not a function ?
[error] TypeError: node.error is not a function
at errorHandler (/opt/node_modules/node-red-contrib-cast/cast-to-client.js:52:10)
at getSpeechUrl (/opt/node_modules/node-red-contrib-cast/cast-to-client.js:192:9)
at Timeout._onTimeout (/opt/node_modules/node-red-contrib-cast/cast-to-client.js:836:33)
at listOnTimeout (node:internal/timers:561:11)
at processTimers (node:internal/timers:502:7)
[11:33:11] WARNING: Node-RED crashed, halting add-on
[11:33:11] INFO: Node-RED stoped, restarting...
s6-rc: info: service legacy-services: stopping
[11:33:11] INFO: Node-RED stoped, restarting...
s6-svwait: fatal: supervisor died
running nodered as an HA add-on if it makes any difference
V3.0.2 (latest available version under HA)
by commenting out some of the affected lines it works without crashing but this shouldn't happen.
I saw that post but the castV2 node is not nearly as user friendly as the cast node so I just wanted to let the NR team know that calling a valid function (node.error) seems to cause a full NR crash, so that perhaps some bug could be identified / fixed
It is a bug in the nodes code, not a issue with Node-RED. The author of the node is the one who needs to fix the problem, but the node hasn't been updated in two years.
You have a couple choices
add an issue to the node and hope the author will fix it
If a node generates an uncaught exception then the only safe thing for node-red to do is to shutdown. It may indicate a catastrophic failure of some sort in the system and any other action by node-red might make things worse.
I hope that by simply commenting out the lines the log mentioned I'm not going to mess up anything else.
As far as a fix, this is as far as my knowledge goes to be honest, but at least it seems to be working at the moment.