What pi are you using?
Please start up node-red and cause the crash again. Then copy the node-red log from the startup thru the crash and paste it to a reply.
In order to make code more readable and importable it is important to surround your code with three backticks
```
like this
```
You can edit and correct your post by clicking the pencil icon.
See this post for more details - How to share code or flow json