Time to read: 1 min
For the complete documentation index, see llms.txt
Common Errors and Tips
This section provides help on some potential issues you may run into and tips on how to resolve them.
Summary
Common Hardhat errors when developing on Rootstock and how to fix them.
| Error | Fix |
|---|---|
HH8: Invalid account in config (Expected string, received undefined for rskMainnet / rskTestnet) | Match .env values to hardhat.config.js. Run source .env in the project root |
| Nothing to compile | Delete the artifacts folder. Run npx hardhat compile again |
| GET /MyToken.json 404 | Confirm contracts compiled and artifacts exists. Follow interact with frontend steps in order |
| HH601: Script scripts/deploy.js doesn't exist | Run npx hardhat run --network hardhat scripts/deploy.js from the project root directory |
Errors
% npx hardhat compile
Error HH8: There's one or more errors in your config file:
* Invalid account: #0 for network: rskMainnet - Expected string, received undefined
* Invalid account: #0 for network: rskTestnet - Expected string, received undefined
To learn more about Hardhat's configuration, please go to https://hardhat.org/config/
For more info go to https://hardhat.org/HH8 or run Hardhat with --show-stack-traces
- FIX 1: Ensure the values in the environment variables matches with the hardhat network configuration
hardhat.config.jsfile. For bash, runsource .envin the root directory for dotenv to enable the environment variables.
% npx hardhat compile
Nothing to compile
- FIX 2: Delete artifacts folder and run the
npx hardhat compilecommand to generate new artifacts.
- Check that contracts were compiled successfully, and artifacts folder was generated.
- Check that all the steps in interacting with frontend were followed sequentially.
- Ensure that you're running the
npx hardhat run --network hardhat scripts/deploy.jscommand from the root directory.