Node-red-contrib-cron-plus example fail

Using the latest NR and cronplus node, I thought I would take cronplus out for a spin using the "using dates" example. When I hit inject I get this error msg:
{"__enc__":true,"type":"error","data":{"name":"TypeError","message":"(intermediate value).addSeconds is not a function","stack":"TypeError: (intermediate value).addSeconds is not a function\n at Function node:a5cda63.977e558 [create payload to add 2 dates]:2:31\n at Function node:a5cda63.977e558 [create payload to add 2 dates]:12:3\n at Script.runInContext (node:vm:149:12)\n at processMessage (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/10-function.js:504:37)\n at FunctionNode._inputCallback (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/10-function.js:422:17)\n at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:214:26\n at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)\n at Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:206:11)\n at Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:190:25)"}}

I'm assuming perhaps the node has been updated and left the example behind?

Cheers
Bob

Also, probably unrelated, but I managed to crash NR (consistently) by firing the cronplus node with a blank date-sequence expression. First time was accidental, but thought I would have another go, and Bingo !

[red] Uncaught Exception:
23 Aug 16:53:23 - [error] TypeError: Cannot read properties of undefined (reading 'node_topic')
    at sendMsg (/home/dev/.node-red/node_modules/node-red-contrib-cron-plus/cronplus.js:947:30)
    at CronPlus._inputCallback (/home/dev/.node-red/node_modules/node-red-contrib-cron-plus/cronplus.js:1045:23)
    at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:214:26
    at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
    at Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:206:11)
    at Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:190:25)
    at Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:506:10)
    at /home/dev/.node-red/node_modules/node-red-contrib-cron-plus/cronplus.js:1953:22
    at Layer.handle [as handle_request] (/usr/lib/node_modules/node-red/node_modules/express/lib/router/layer.js:95:5)
    at next (/usr/lib/node_modules/node-red/node_modules/express/lib/router/route.js:149:13)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.

Could you share the exact flows causing these issues? I realise you said one of them comes from the examples directory, but I would prefer to receive your exact flow as an export just in case something went screwy.

Also, could you tell the version of CronPlus installed, the node JS version and the node red version you are using. Thanks.

I can confirm the first problem. Imported the "using dates" example flow, deployed, clicked on the top inject and got the error.

Using the latest versions of CRON+ (2.2.4) and Node-RED on Linux.

The error is in the function node. (new Date()).addSeconds(30) is not valid JavaScript. It should be something like:

const date = new Date();

let nowPlus30s = date.setSeconds(date.getSeconds() + 30);
let nowPlus1min = date.setSeconds(date.getSeconds() + 60);

fixed in Fix dates demo and handle crash by Steve-Mcl · Pull Request #125 · Steve-Mcl/node-red-contrib-cron-plus · GitHub

Version 2.2.5 will be along soon