question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

complete 1.js file is being displayed in the terminal if ganache used programatically

See original GitHub issue

In my project i was using ganache programatically and passing options as an argument to the provider. If any error occurs it should show only error but it prints complete 1.js file in the terminal in my node project. We can handle the issue with, 1. Prettifying minified 1.js file and other is to use try catch whenever using ganache instance. This problem is similar to solidity’s solcjson.js error. var ganache = require('ganache'); options = { miner: { blockGasLimit: "5F5E100" }, } provider = ganache.provider(options); Here gaslimit should be in hex but i have put this without 0x to recreate the errror. It would be great if this problem is solved.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aniketpcsynccommented, Feb 6, 2022

We bundle our packages to reduce installation time, and at the same time we minify it all. In doing so we generate source maps, files that can map characters in the minified file to their original source.

Node.js doesn’t automatically read these source map files (but browsers do, in certain situations), so you have to use source-map-support to add support.

The downside to using source-map-support for you is that this will slow down the initialization of your application (i’m not sure how slow ganache’s source map loading can be). There is also a downside for everyone, even if they don’t use source-map-support, since it increases our bundle size, which defeats the purpose of minifying in the first place!

Thank you so much for the answer !

1reaction
davidmurdochcommented, Feb 5, 2022

We bundle our packages to reduce installation time, and at the same time we minify it all. In doing so we generate source maps, files that can map characters in the minified file to their original source.

Node.js doesn’t automatically read these source map files (but browsers do, in certain situations), so you have to use source-map-support to add support.

The downside to using source-map-support for you is that this will slow down the initialization of your application (i’m not sure how slow ganache’s source map loading can be). There is also a downside for everyone, even if they don’t use source-map-support, since it increases our bundle size, which defeats the purpose of minifying in the first place!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Executing shell command using child process - Stack Overflow
When I replace the command with 'dir', it works perfectly and lists the files in the directory. Even if I remove the node...
Read more >
ganache - npm
A tool for creating a local blockchain for fast Ethereum development. Features • Getting Started • Documentation • Community • Docker ...
Read more >
Ganache 7 Ethereum Simulator - Building on Web3 is now ...
We are excited to announce the wide release of the latest version of Ganache today, ... Ganache 7 can be used programmatically in...
Read more >
v7.0.0 · Discussion #2121 · trufflesuite/ganache - GitHub
If you do, or if you want to keep up with all things Ganache, ... We're proud of this one and will likely...
Read more >
Deploying and interacting with smart contracts
The Ethereum blockchain (often called "mainnet", for "main network") requires spending real money to use it, in the form of Ether (its native...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found