-
Notifications
You must be signed in to change notification settings - Fork 251
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Layerzero oft contracts + Hardhat v3 combination throws an error like
Error HHE902: There was an error while resolving the import "@layerzerolabs/oft-evm/contracts/OFTAdapter.sol" from "./contracts/MyOFTAdapter.sol":
The file "contracts/OFTAdapter.sol" is not exported by the package.
I guess the same occurs with the other contracts too, but didn't check that out.
To Reproduce
Steps to reproduce the behavior:
yarn add --dev hardhat @layerzerolabs/oft-evm(I get"hardhat": "^3.0.6")yarn hardhat init- Add oft adapter contract from layerzero quickstart
yarn hardhat compile
Expected behavior
Successful compilation
Environment (please complete the following information):
- OS: macOS
- OS Version: 15.6.1
- VM: nodejs
- VM Version: v24.5.0
Additional context
I'm not that familiar with nodejs ecosystem, but I guess the issue is that hardhat v3 now forces(?) ESM usage via "type": "module". While your package.json has exports section, it lacks contracts directory, which seems to me as a reason of compilation error.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working