Skip to main content
Time to read: 1 min

Common Errors and Tips

This section provides help on some potential issues you may run into and tips on how to resolve them.

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.js file. For bash, run source .env in 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 compile command 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.js command from the root directory.
Last updated on by ivegabr

On this page

Feedback