wighawag / hardhat-deploy-ethers

MIT License
70 stars 25 forks source link

hardhat-deploy-ethers not compatible with hardhat-toolbox when using npm #27

Closed jiaochangyang closed 1 year ago

jiaochangyang commented 2 years ago

Hi,

I am unable to install hardhat-deploy-ethers when I have hardhat-toolbox in my dependencies. My package.json dependencies look like:

"devDependencies": {
        "@nomicfoundation/hardhat-toolbox": "^1.0.2",
        "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13",
        "ethers": "^5.5.4",
        "hardhat": "^2.10.1",
        "hardhat-deploy": "^0.11.11"
}

I've tested with npm v.8.11.0 (which is bundled with Node 16LTS) as well as the latest v8.15.0. The error received is:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @nomicfoundation/hardhat-chai-matchers@1.0.2
npm ERR! Found: @nomiclabs/hardhat-ethers@0.3.0-beta.13
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   dev @nomiclabs/hardhat-ethers@"npm:hardhat-deploy-ethers@^0.3.0-beta.13" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomicfoundation/hardhat-chai-matchers@1.0.2
npm ERR! node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR!   peer @nomicfoundation/hardhat-chai-matchers@"^1.0.0" from @nomicfoundation/hardhat-toolbox@1.0.2
npm ERR!   node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!     dev @nomicfoundation/hardhat-toolbox@"^1.0.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @nomiclabs/hardhat-ethers@2.1.0
npm ERR! node_modules/@nomiclabs/hardhat-ethers
npm ERR!   peer @nomiclabs/hardhat-ethers@"^2.0.0" from @nomicfoundation/hardhat-chai-matchers@1.0.2
npm ERR!   node_modules/@nomicfoundation/hardhat-chai-matchers
npm ERR!     peer @nomicfoundation/hardhat-chai-matchers@"^1.0.0" from @nomicfoundation/hardhat-toolbox@1.0.2
npm ERR!     node_modules/@nomicfoundation/hardhat-toolbox
npm ERR!       dev @nomicfoundation/hardhat-toolbox@"^1.0.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I could technically fix it by forcing the dependencies or using legacy-peer-deps but thought it might be good to raise this issue.

wottpal commented 2 years ago

@wighawag i guess that's the same issue i also have with #28

wighawag commented 2 years ago

@wottpal yes most likely, The blocker is on hardhat repo : https://github.com/NomicFoundation/hardhat/issues/1040

wottpal commented 2 years ago

Ok, but definitely thanks for the quick follow-up here. It's nice to know that you are on it :)

KirchZ commented 1 year ago

Hi! Is there any workaround while the 1040 issue is fixed?

wottpal commented 1 year ago

@wighawag any updates on this? can we help?

wighawag commented 1 year ago

Hey @wottpal Franco has made a PR to finally fix the issue but I did not get yet the time to look at it : https://github.com/wighawag/hardhat-deploy-ethers/pull/30

wottpal commented 1 year ago

Really nice. Had a look, but unfortunately it's really only the function interfaces that seem to be in the PR yet.

wighawag commented 1 year ago

hardhat-deploy-ethers@next has been released Please, try it out.

It is now an extension to hardhat-ethers so you need both

But note that that new version do not support external artifact if you were using them