altv-js-module
altv-js-module copied to clipboard
Server process.on events handling is broken
Description of the problem
process.on events are duplicated (rarely on server startup) and server freezes after resource restart
Reproduction steps
process.on("uncaughtException", (error) => {
console.log("uncaughtException", error.stack);
});
setTimeout(() => { throw new Error("test") }, 0);
- restart resource
Expected behaviour
.
Additional context
No response
Operating system
Windows 11
Version
dev/10.0-dev4
Scope
server
Still the case after NodeJS update?
yes
@LeonMrBonnie seems like handled exception with process.on("uncaughtException") in setImmediate even crashes v8
process.on("uncaughtException", (error) => {
console.log("uncaughtException", error.stack);
});
setImmediate(() => {
throw new Error('kek');
});