Lesson 9: Hardhat Node Stopped Working #4892
-
Hello, So I am not actually on Lesson 9, I already did it, but when I checked back on it and ran Error HH604: Error running JSON-RPC server: ERROR processing skip func of /Users/user/hh-fcc/hardhat-lottery-fcc/deploy/00-deploy-mocks.js:
TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')
at Object.<anonymous> (/Users/user/hh-fcc/hardhat-lottery-fcc/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:4:61)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Function.Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/Users/user/hh-fcc/hardhat-lottery-fcc/node_modules/@nomiclabs/hardhat-ethers/src/internal/provider-proxy.ts:7:1)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10) I also migrated from Yarn Classic to Yarn Berry recently, so it might have something to do with this problem? Also, I looked at similar posts, and they solved the problem by running
Here's my 00-deploy-mocks.js- const { network } = require("hardhat")
const { developmentChains } = require("../helper-hardhat-config")
const BASE_FEE = ethers.utils.parseEther("0.25")
const GAS_PRICE_LINK = 1e9
module.exports = async function ({ getNamedAccounts, deployments }) {
const { deploy, log } = deployments
const { deployer, player } = await getNamedAccounts()
const chainId = network.config.chainId
const args = [BASE_FEE, GAS_PRICE_LINK]
if (developmentChains.includes(network.name) || chainId == 31337) {
log("Local network detected. Deploying mocks...")
await deploy("VRFCoordinatorV2Mock", {
contract: "VRFCoordinatorV2Mock",
from: deployer,
log: true,
args: args,
})
log("Mocks successfully deployed.")
log("------------------------------------------------------------")
}
}
module.exports.tags = ["all", "mocks"] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
remove this and add |
Beta Was this translation helpful? Give feedback.
-
@Undefined-github Which ethers version are you using? make sure it should be less than 6 because version 6 is in beta. |
Beta Was this translation helpful? Give feedback.
@Undefined-github Which ethers version are you using? make sure it should be less than 6 because version 6 is in beta.