Skip to content
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

npx hardhat coverage --testfiles "test/gie-token-test.js" --network rinkeby #732

Closed
Bhupesh-98 opened this issue Jul 25, 2022 · 6 comments
Closed

Comments

@Bhupesh-98
Copy link

Bhupesh-98 commented Jul 25, 2022

I am trying to create coverage report of contracts I have created by running tests on rinkeby test network but facing problem stated below:

Command used -> npx hardhat coverage --testfiles "test/gie-token-test.js" --network rinkeby

The above command gives error : Error in plugin solidity-coverage: TypeError [ERR_INVALID_URL]: Invalid URL

Originally posted by @Bhupesh-98 in #655 (comment)

@clemsos
Copy link

clemsos commented Oct 24, 2023

same error here after upgrading from 0.8.2 -> 0.8.5, without a network specified (running on default hardhat

@cgewecke
Copy link
Member

@clemsos Took a look at unlock and I see the error in your CI.

Would it be possible debug this by changing your coverage command in package.json to ?

hardhat coverage --network hardhat

This should coerce the task to use the built-in provider and help isolate the source of the problem (which might be in your network configuration logic).

@clemsos
Copy link

clemsos commented Oct 26, 2023

hello @cgewecke, thank you very much for the answer. I just tried here unlock-protocol/unlock#12856 but no luck. I am still having thee same error

Downloading compiler 0.8.21
Downloading compiler 0.7.6
Compiled 151 Solidity files successfully
Error in plugin solidity-coverage: TypeError: Invalid URL

HardhatPluginError: TypeError: Invalid URL
    at SimpleTaskDefinition.action (/home/unlock/node_modules/solidity-coverage/plugins/hardhat.plugin.js:274:35)
    at Environment._runTaskDefinition (/home/unlock/node_modules/hardhat/src/internal/core/runtime-environment.ts:330:14)
    at Environment.run (/home/unlock/node_modules/hardhat/src/internal/core/runtime-environment.ts:163:14)
    at main (/home/unlock/node_modules/hardhat/src/internal/cli/cli.ts:277:7)
1

I'll double check my networks config

@cgewecke
Copy link
Member

@clemsos Hmm, strange. Will take a closer look....

@cgewecke
Copy link
Member

@clemsos Apologies, could you also bump hardhat up to the latest version? (I think you have it at 2.15.0).

There were changes at Hardhat and here to support an async provider creation pattern in #796 for 2.15.0 and maybe they had to patch something subsequently?

@clemsos
Copy link

clemsos commented Oct 30, 2023

Yes, this was a version issue with hardhat that has been fixed by upgrading it.. Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants