Replies: 5 comments 3 replies
-
Could you leave a minimal reproducible code snippet? I think your JS code brings up an event loop so that Node.js runtime refuses to exit. The key is to close that event loop in JS. |
Beta Was this translation helpful? Give feedback.
-
Thank you for answering.
the other scripts that i execute them are a web page scripts that implemented using react. |
Beta Was this translation helpful? Give feedback.
-
That is not a complete code snippet. I think in your case, you don't need to call |
Beta Was this translation helpful? Give feedback.
-
Sorry, but the other part of scripts that will execute are not mine. they are the scripts of the websites, that includes some http requests such as rest calls. when i don't call |
Beta Was this translation helpful? Give feedback.
-
Then, I suspect there are some http connections not closed in your application. Node.js is designed to drain the event loop before exiting. I suggest you use something like fiddler/wireshark to monitor the http connections to find out which ones are blocked. |
Beta Was this translation helpful? Give feedback.
-
Hi every body.
I have a problem with javet on 'Node' mode. I'm using javet + jsdom inside it as ssr module.
Main functionality is OK and i can render a page implemented using React.
But the problem is closing NodeRuntime!
I need to use runtime.await to activate node event-loop. As it's described in below link, I've created a worker thread and called 'runtime.await' inside it. But unfortunately i can not close the worker thread and NodeRuntime without closing whole application. Can anyone help me?
https://www.caoccao.com/Javet/tutorial/advanced/interact_with_node_js.html
Beta Was this translation helpful? Give feedback.
All reactions