NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.21k stars 1.38k forks source link

Throws "Option:unwrap() on None" #5784

Open peersky opened 1 day ago

peersky commented 1 day ago

Version of Hardhat

2.22.12

What happened?

Getting error when running my tests:

Error: called `Option::unwrap()` on a `None` value
      at EdrProviderWrapper._rawTraceToSolidityStackTrace (node_modules/.pnpm/hardhat@2.22.12_bufferutil@4.0.8_ts-node@10.9.2_@types+node@17.0.45_typescript@5.6.2__typescr_fivwhmpgpti4rjcnin4liao2wi/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:584:38)
      at EdrProviderWrapper.request (node_modules/.pnpm/hardhat@2.22.12_bufferutil@4.0.8_ts-node@10.9.2_@types+node@17.0.45_typescript@5.6.2__typescr_fivwhmpgpti4rjcnin4liao2wi/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:424:33)
      at async EthersProviderWrapper.send (node_modules/.pnpm/@nomiclabs+hardhat-ethers@2.2.3_ethers@5.7.2_bufferutil@4.0.8_utf-8-validate@5.0.10__hardhat@_5uj7fj26vun34ezzedn6lrmbnm/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

Minimal reproduction steps

Likely because of 2.22.12 release (does not happen in 2.22.11).

here is my dependency list:

"devDependencies": {
    "@changesets/changelog-github": "^0.4.8",
    "@changesets/cli": "^2.26.2",
    "@nomicfoundation/hardhat-chai-matchers": "^1.0.1",
    "@nomicfoundation/hardhat-network-helpers": "^1.0.9",
    "@nomicfoundation/hardhat-toolbox": "^2.0.2",
    "@nomiclabs/buidler": "^1.4.8",
    "@nomiclabs/buidler-web3": "^1.3.4",
    "@nomiclabs/hardhat-ethers": "^2.0.6",
    "@nomiclabs/hardhat-etherscan": "^3.1.8",
    "@peeramid-labs/eds": "^1.0.0",
    "@shopify/eslint-plugin": "^43.0.0",
    "@solidstate/contracts": "^0.0.35",
    "@typechain/ethers-v5": "^11.1.2",
    "@typechain/hardhat": "^7.0.0",
    "@typechain/web3-v1": "^6.0.1",
    "@types/cli-table": "^0.3.0",
    "@types/crypto-js": "^4.1.1",
    "@types/node-fetch": "^2.6.2",
    "@typescript-eslint/parser": "^7.16.0",
    "chai": "^4.3.6",
    "crypto-js": "^4.1.1",
    "eslint": "^9.6.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-promise": "^6.4.0",
    "eth-create2-calculator": "^1.1.5",
    "ethers": "^5.6.6",
    "globals": "^15.9.0",
    "hardhat": "=2.22.11",
    "hardhat-abi-exporter": "^2.9.0",
    "hardhat-contract-sizer": "^2.6.1",
    "hardhat-deploy": "^0.12.2",
    "hardhat-diamond-abi": "^3.0.0",
    "keccak": "^3.0.1",
    "mocha": "^10.0.0",
    "prettier-plugin-solidity": "^1.1.3",
    "solhint": "^3.6.2",
    "solidity-coverage": "^0.8.5",
    "solidity-docgen": "^0.6.0-beta.36",
    "typechain": "^8.0.0",
    "web3": "^1.8.2"
  },
  "dependencies": {
    "@aragon/osx": "^1.3.0",
    "@aragon/osx-ethers": "^1.3.0",
    "@aragon/sdk-client": "^1.26.0",
    "@ethersproject/abi": "^5.7.0",
    "@ethersproject/providers": "^5.7.2",
    "@openzeppelin/contracts": "^5.0.0",
    "@openzeppelin/contracts-upgradeable": "^5.0.0",
    "@safe-global/safe-contracts": "1.4.1-build.0",
    "@types/chai": "^4.3.1",
    "@types/mocha": "^9.1.1",
    "@types/node": "^17.0.36",
    "chalk": "^4.1.2",
    "cli-table": "^0.3.11",
    "hardhat-gas-reporter": "^1.0.9",
    "ts-node": "^10.9.1",
    "typescript": "^5.2.2"
  }

Search terms

No response

holyhansss commented 2 hours ago

I recommend using Hardhat version 2.22.9. After updating to a newer version, I encountered an unexpected issue where my tests began throwing an 'Option:unwrap() on None' error. Reverting to the previous version should resolve this problem.

    "hardhat": "^2.22.9",