-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
solc-js throws a massive error on unhandled promise rejection #12228
Comments
This seems to be an issue with emscripten and the binary it builds, not
So if we do this, we might have to at least bump the minimum node.js requirement. We might also need #11689 - we're on emscripten 2.0.12 now, released in January and the flag seems to have been added just after that release (changelog does not mention it though).
Right, this is very annoying. We seem to have some workarounds for it because I'm not seeing it as much in newer versions of solc-js and the compiler but when it does happen the output just obscures everything. @ekpyron maybe we could use the |
Duplicate of ethereum/solc-js#505 |
Sorry, closed this because it said "duplicate" |
So we had this issue before, didn't we? And we added some workarounds that look similar to the last one suggested in the description. |
Yeah, it's technically a duplicate but this one had better description. I'd close the other one but I thought it being open in solc-js might help people who have this issue find the workaround. I'd be fine with just closing it though.
We did - ethereum/solc-js#505 was reported in December 2020 - but I don't think we did anything in response to that. I can reproduce the problem on 0.8.9 which means it has no workaround. |
Hey, you can take a look at this answer trufflesuite/ganache#2289 # # |
This comment was marked as outdated.
This comment was marked as outdated.
Ah, wait, it was not a question. So you're suggesting to use source maps? I'm not even sure we generate them. If we do, we discard them immediately. And I also think that disabling the minification would be much better than minifying and then having to ship source maps that negate all the speed and size benefits. |
Hi @smartcontracts! 👋 We believe this issue is fixed on our newest versions, can you try to reproduce it? |
Nice! Can confirm this is fixed in versions >=0.8.12 |
Thank you for confirming. Cheers! 🙌 |
solc-js
throws a massive error on unhandled promise rejections. Here's a simple script you can use to reproduce:Running this script will dump entire source of
soljson.js
to your terminal.soljson.js
throws the followingRuntimeError
:NodeJS wants to show you the line on which the error was triggered but
soljson.js
is a minified file where the entire source is on a single line. As a result, it prints out the entire source ofsoljson.js
. Upon cleaning up the file withjs-beautify
I no longer get the entire source dumped and get the following useful error:This error comes from the following function inside of
soljson.js
:Which is triggered because of this listener:
I've found various workarounds to this problem. One relatively easy workaround is to remove the listener:
However, it would be great to have a canonical fix to this problem.
The text was updated successfully, but these errors were encountered: