I'm following this Alchemy tutorial on how to deploy a smart contract on the Sepolia testnet. When I try to compile my smart contract, I get these errors:
Error HH8: There's one or more errors in your config file:
* Invalid value undefined for HardhatConfig.networks.sepolia.url - Expected a value of type string.
* Invalid account: #0 for network: sepolia - private key too short, expected 32 bytes
Here is my hardhat.config.ts file
require("dotenv").config();
require("@nomiclabs/hardhat-ethers");
const { API_URL, PRIVATE_KEY } = process.env;
module.exports = {
solidity: "0.7.3",
defaultNetwork: "sepolia",
networks: {
hardhat: {},
sepolia: {
url: API_URL,
accounts: [`0x${PRIVATE_KEY}`],
},
},
};
I've included my private key and the api_url in a .env
file
I'm not sure where the invalid errors are coming from