Hardhat deploy script #6664
-
|
I'm working on a Hardhat project and encountering: This happens when I run my const amount = ethers.utils.parseEther("1.0");I have this at the top of the file: const { ethers } = require("hardhat");But System:
Other parts of the script like Full error: const amount = ethers.utils.parseEther("1.0"); // 1 ETH in wei
^
TypeError: Cannot read properties of undefined (reading 'parseEther')
at Object.<anonymous> (.../scripts/deploy.js:8:29)
at Module._compile (node:internal/modules/cjs/loader:1554:14)
at Object..js (node:internal/modules/cjs/loader:1706:10)
at Module.load (node:internal/modules/cjs/loader:1289:32)
at Function._load (node:internal/modules/cjs/loader:1108:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
at node:internal/main/run_main_module:36:49 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hey @Aggregator2, could you check that you have the https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-ethers#installation The missing connection is the most likely reason that |
Beta Was this translation helpful? Give feedback.
Hey @Aggregator2, could you check that you have the
hardhat-ethersplugin installed and included in yourhardhat.config.{js,ts}:https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-ethers#installation
The missing connection is the most likely reason that
ethersis undefined when you import it.