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

Error with yarn coverage #36

Open
joelamouche opened this issue Apr 18, 2023 · 7 comments
Open

Error with yarn coverage #36

joelamouche opened this issue Apr 18, 2023 · 7 comments

Comments

@joelamouche
Copy link
Contributor

Even after building with forge, I get these errors when running yarn coverage :

yarn run v1.22.10
$ npx hardhat coverage --solcoverjs ./.solcover.js

Version
=======
> solidity-coverage: v0.7.22

Instrumenting for coverage...
=============================

> MockTokenVesting.sol
> Token.sol
> TokenVesting.sol

Compilation:
============

Compiling 7 files with 0.8.19
ParserError: Source "solmate/tokens/ERC20.sol" not found: File not found. Searched the following locations: "".
 --> src/Token.sol:7:1:
  |
7 | import {ERC20} from "solmate/tokens/ERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


ParserError: Source "solmate/tokens/ERC20.sol" not found: File not found. Searched the following locations: "".
 --> src/TokenVesting.sol:8:1:
  |
8 | import {ERC20} from "solmate/tokens/ERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


ParserError: Source "solmate/auth/Owned.sol" not found: File not found. Searched the following locations: "".
 --> src/TokenVesting.sol:9:1:
  |
9 | import {Owned} from "solmate/auth/Owned.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


ParserError: Source "solmate/utils/SafeTransferLib.sol" not found: File not found. Searched the following locations: "".
  --> src/TokenVesting.sol:10:1:
   |
10 | import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


ParserError: Source "solmate/utils/ReentrancyGuard.sol" not found: File not found. Searched the following locations: "".
  --> src/TokenVesting.sol:11:1:
   |
11 | import {ReentrancyGuard} from "solmate/utils/ReentrancyGuard.sol";
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Error in plugin solidity-coverage: HardhatError: HH600: Compilation failed

For more info run Hardhat with --show-stack-traces
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@mujahid002
Copy link

once check version used in .sol files and package.json, must use same version.Fix to one version and develop projects :)

@joelamouche
Copy link
Contributor Author

@mujahid002 the versions of what are you referring to please?

@mujahid002
Copy link

@mujahid002 the versions of what are you referring to please?

I use ^0.8.6, try to use >=0.8.0 and while using any frameworks like truffle,hardhat once check solidity version in package.json

@joelamouche
Copy link
Contributor Author

What package are you refering to when you say you use ^0.8.6 ?

@GGAlanSmithee
Copy link

GGAlanSmithee commented Jul 23, 2023

@mujahid002 I understand there is some discrepancy between package versions, but I'm having a bit of a struggle figuring out the correct configuration. Would you mind providing more information? Thanks.

@zerodev68
Copy link
Contributor

I have same error. How can fix it?

@mujahid002
Copy link

While importing packages please check it whether its correctly importing from node_modules!

For eg: import "../../node_modules/zeppelin-solidity/contracts/math/SafeMath.sol";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants