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

compile with console.sol fails when run with npx #5904

Closed
kanej opened this issue Oct 30, 2024 · 0 comments
Closed

compile with console.sol fails when run with npx #5904

kanej opened this issue Oct 30, 2024 · 0 comments
Assignees
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Milestone

Comments

@kanej
Copy link
Member

kanej commented Oct 30, 2024

The import resolution hardhat/console.sol works if you compile with pnpm but fails if you use npx.

Reproduction steps

mkdir compile-error 
cd compile-error
hardhat3 --init
# pick the viem stack

# compile the contracts created by default
npx hardhat3 compile                      
# in `./contracts/Lock.ts`, uncomment the line
# // import "hardhat/console.sol";

# rerun the contracts compile
npx hardhat3 compile
# Compiling your Solidity contracts
# Error HHE1206: The import "hardhat/console.sol" from "contracts/Lock.sol" is trying to use # an uinstalled npm dependency.

# For more info go to https://hardhat.org/HHE1206 or run Hardhat with --show-stack-traces

However pnpm hardhat3 compile will compile successfully.

@kanej kanej added the v-next A Hardhat v3 development task label Oct 30, 2024
@kanej kanej added this to the Private Alpha milestone Oct 30, 2024
@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Oct 30, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Hardhat Oct 30, 2024
@kanej kanej moved this from Backlog to To-do in Hardhat Oct 30, 2024
@kanej kanej closed this as completed Oct 31, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Hardhat Oct 31, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Projects
Archived in project
Development

No branches or pull requests

2 participants