Open scxr opened 6 days ago
const originalOn = process.on;
process.on("uncaughtException", handleGlobalError);
process.on("unhandledRejection", handleGlobalError);
process.on = function (event, listener) {
if ((event === 'uncaughtException' || event === 'unhandledRejection') &&
(new Error().stack || '').includes('node_modules/brotli')) {
console.warn(`Ignoring ${event} listener from brotli`);
return process;
}
return originalOn.call(this, event, listener);
};
a temporary fix is this, however it is unideal (for anyone who happens to stumble upon this)
I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project
Summary When using uniswap/smart-order-router which introduces the brotli (and by extension Emscripten) module it has broken process.on("uncaughtException")
Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
This is the output when process.on("unhandledException") is triggered
I believe it is related to this issue on brotli https://github.com/foliojs/brotli.js/issues/37 however as far as im aware we do not have ability to determine how emcscript is compiled, please make it so by default this functionality is turned off