Open lost-bits opened 2 years ago
Okay, so here is the problem im detail:
as @Steve-Mcl wrote, it is caused by an error which the node throws around in line 66 of file node-red-watchdirectory.js.
watcher.on('ready', () => {
setTimeout(() => {
node.status({fill:"yellow", shape: "ring", text: "Listening..."})
}, 10000)
}).on('error', (err) => {
node.status({fill:"red", shape: "dot", text: "Error : "+err.message})
throw(err)
})
if you replace the throw(err) by node.error(err), it will report in node RED and keep it alive, even if the error occurs more than one time.
Even with this new kind of error handling, the node does not start to recover.
What I found out so far, is that:
1) this only happens, IF you configured a NON-existing dir to watch .... 2) you create a dir afterwars (no matter how the dir is called)...
If the dir exisits, and it is watched, the node does not fail to error.
Hi, i don't maintain this repo anymore, but i can change owner if there are somebody who want maintain.
Uhh ... thats sad ... I use this node at the moment a bit... and I will try to fix it (if possible) ... but since I dont know where at chokidar the error is created, I guess, i should ask there ...
If I find the fix, I will post it here ...
you can push a MR and i can merge
Will do so, if I find the solution. The current one in the issue just fixes the NodeRED crash issue.
@fatoldsun00 I have create a pull request (https://github.com/fatoldsun00/node-red-contrib-watchdirectory/pull/12) with a little change that solve this problem (I tested in my environment node-red 3.1.3, windows 10, node.js 18 and act as expected).
Commit is identical as that proposed by @lost-bits.
@fatoldsun00 thanks for merging pull request, could you publish this update with npm ?
Hi, it's done. Thansk for your PR
Thanks to you @fatoldsun00
I in documented a issue, which is also caused by your node.
https://github.com/node-red/node-red/issues/3355