Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception rather than clear message on unknown build profile #6316

Open
kanej opened this issue Feb 17, 2025 · 0 comments
Open

Exception rather than clear message on unknown build profile #6316

kanej opened this issue Feb 17, 2025 · 0 comments
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task

Comments

@kanej
Copy link
Member

kanej commented Feb 17, 2025

If the user runs a task with an unknown build profile, we get a typeerror:

npx hardhat compile --build-profile nonexistant
Compiling your Solidity contracts
An unexpected error occurred:

TypeError: Cannot read properties of undefined (reading 'overrides')
# ... lots more lines of stack trace ...
If you think this is a bug in Hardhat, please report it here: https://hardhat.org/report-bug

We should report a specific named error instead, it should not be reported to Sentry. For reference here is what happens when network does not exist:

npx hardhat run ./scripts/send-op-tx.ts --network nonexistant               
Compiling your Solidity contracts
Compiled 3 Solidity files with solc 0.8.24 (evm target: shanghai)

Error HHE705: The network nonexistant is not defined in your networks config.

For more info go to https://hardhat.org/HHE705 or run Hardhat with --show-stack-traces
@kanej kanej added the v-next A Hardhat v3 development task label Feb 17, 2025
@kanej kanej added this to the Public Alpha milestone Feb 17, 2025
@kanej kanej added this to Hardhat Feb 17, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Hardhat Feb 17, 2025
@kanej kanej moved this from Backlog to To-do in Hardhat Feb 17, 2025
@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Projects
Status: To-do
Development

No branches or pull requests

1 participant