This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 679
Fix sourcemap support once and for all #879
Comments
The next version of ganache core will handle source-map-support properly (via # 1), and truffle will soon as well: trufflesuite/truffle#3929 p.s., |
That's perfect @davidmurdoch. Should I close this now or when it gets merged? |
This is awesome news! Thanks @davidmurdoch! |
davidmurdoch
changed the title
Fix surcemap support once and for all
Fix sourcemap support once and for all
Mar 23, 2021
@krzkaczor no need to close it. We'll handle it once 7.0 goes out. |
For anyone looking for a really quick fix (read: hack), this worked for me in the meanwhile: package.json "scripts": {
"postinstall": "cat /dev/null > node_modules/source-map-support/register.js",
} Resolutions, themselves, did not fix the issue for me. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Problem:
ganache-core
requiressource-map-support/register
at top module scope.source-map-support
multiple times in different versions leads to broken source map support: Activating source-map-support several times leads to issues evanw/node-source-map-support#200@eth-optimism/plugins/hardhat/ethers
breaks source map support ethereum-optimism/plugins#29Quick workaround:
source-map-support
is able to ąvoid re-registering if one particular version is registered multiple times so a reasonable workaround is to force install only one particular version. To do this add inpackage.json
:Real solution:
I see few solutions to this problem:
Not to import
source-map-support
in this library at all.source-map-support
was designed not to be included in other libraries. I believe that it should be importing in some kind of executors likeganache-cli
Import it only when not in tests as celo did in their fork: celo-org/ganache-core@3dbc32b - I am not sure about this solution.
Try to push a fix to
source-map-support
to detect multiple registers across different versions. Fix seems to be easy to create but the library doesn't seem to be maintained anymore.@gnidan I am linking past discussion with @sz-piotr: trufflesuite/truffle#3432
Let me know how can I help to get this fixed.
The text was updated successfully, but these errors were encountered: