-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requiring the module changes default bahavior of process.on('unhandledRejection') #9
Comments
That part is auto-generated by emscripten. I see 3 potential possibilities:
Do you have time to take a look and localize problem? We did build process as friction-less as possible (via docker). But i don't keep emscripten details in my head, and very busy at current moment. |
Quick googling for "emscripted exit on unhandled rejection" give such kind of links emscripten-core/emscripten#9028. But i did not dived into details. |
I googled and ran into this: It was merged, so if I understand correctly, the default behavior was changed in a way that only if adding So maybe it is only a matter of rebuilding with a new version |
Could you try dev branch and let me know result https://github.com/fontello/wawoff2/tree/dev? |
The artifacts still contain Maybe need to explicitly set flag to 0? |
Could you experiment yourself with options? I can't allocate time now to investigate emscrpten doc and verify everything. Build scripts are quite simple and easy to modify. |
I managed to setup and run a build once, so I'll try to play with the options a bit |
This is the change in the Makefile that worked for me (at least for the above test code)
|
Let me know if you want me to open a PR |
For debug, temporary drop Probably, if we modify this part, worth to use |
process["on"]("unhandledRejection", function(reason) {
throw reason;
});
process["on"]("uncaughtException", function(ex) {
if (!(ex instanceof ExitStatus)) {
throw ex;
}
});
var ENVIRONMENT_IS_WEB = typeof window === "object";
var ENVIRONMENT_IS_WORKER = typeof importScripts === "function";
var ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string"; Turns into this: var ENVIRONMENT_IS_WEB = false;
var ENVIRONMENT_IS_WORKER = false;
var ENVIRONMENT_IS_NODE = true; which might limit the module to only work in NodeJS and not in Browsers I think the first 2 are safe, while the 3rd should probably tested for backward-compatibility |
* Remove override of process.on('uncaughtException') and process.on('unhandledRejection') * Update emscripten SDK
Opened a PR with the change |
Fix issue #9 - overriding process.on('uncaughtException') and process.on('unhandledRejection')
Thank you! Hope you have time to publish a new version as well. |
Published 2.0.1. Thanks for your help! |
@puzrin and @yoavain-sundaysky you are both amazing for fixing this. |
Indeed @yoavain-sundaysky thanks for your contribution to make software safer than before... 👍 |
On NodeJS 14.x unhandled rejection are treated as warnings and do not crash the process.
When requiring the module, the code from
compress_binding.js
is changing this behavior so that any unhandled rejection terminates the process.Here's a code snippet that reproduces the problem:
Expected behavior:
Actual behavior:
Log ends with:
The text was updated successfully, but these errors were encountered: