-
Notifications
You must be signed in to change notification settings - Fork 46
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
Validation is blocked on the entire project when there's an invalid import on a single file. #238
Comments
I am running into this same issue, it started in version 0.4.5 and is still broken, I keep my projects using 0.4.4 and it's working, but i'd like the new features.. |
@JacobRhiel hey we definitely want you to be getting the new features! Could we get some more details? Are you getting a validation issue with a bad import in a dependent file? What happens if you resolve the import issue? |
So, most features work, but the most important, syntax highlighting and compilation.
It only displays this error on 0.4.5 and newer, but gives no insight. No syntax highlighting on any version (other features work, just not compilation): Versions: NPM: 8.16.0 "devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^1.0.2",
"hardhat": "^2.10.1",
"hardhat-abi-exporter": "^2.10.0",
"hardhat-contract-sizer": "^2.6.1",
"hardhat-dependency-compiler": "^1.1.3",
"hardhat-storage-layout": "^0.1.6",
"prettier-plugin-solidity": "^1.0.0-dev.23"
},
"dependencies": {
"@openzeppelin/contracts": "^4.7.0",
"@openzeppelin/contracts-upgradeable": "^4.7.3",
"dotenv": "^16.0.1"
} hardhat.config.ts: import { HardhatUserConfig, task } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox"; // https://www.npmjs.com/package/@nomicfoundation/hardhat-toolbox
import "hardhat-dependency-compiler"; // https://www.npmjs.com/package/hardhat-dependency-compiler
import "hardhat-storage-layout"; // https://www.npmjs.com/package/hardhat-storage-layout
import "hardhat-contract-sizer"; // https://www.npmjs.com/package/hardhat-contract-sizer
import "hardhat-abi-exporter"; // https://www.npmjs.com/package/hardhat-abi-exporter
/* task("accounts", "Prints the list of accounts", async (_, {ethers}) => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
}); */
dotenv.config();
const config: HardhatUserConfig = {
solidity: {
version: process.env.COMPILE_VERSION || "0.8.16",
settings: {
optimizer: {
enabled: process.env.OPTIMIZER == "true",
runs: process.env.OPTIMIZER_RUNS || 200,
},
outputSelection: {
"*": {
"*": ["storageLayout"],
},
}
},
},
gasReporter: {
enabled: process.env.REPORT_GAS == "true"
},
defaultNetwork: process.env.DEFAULT_NETWORK || "hardhat",
networks: {
rinkeby: {
url: process.env.RINKEBY_URI || "",
accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY
},
dependencyCompiler: { // add your dependencies here
paths: [
],
},
abiExporter: {
runOnCompile: process.env.ABI_EXPORTER == "true",
only: [],
}
};
export default config; Also, just trying CLI compilation produces this error on all versions:
|
Added a link on the status item linking to the file that is importing a non existent file.
Added a link on the status item linking to the file that is importing a non existent file.
Added a link on the status item linking to the file that is importing a non existent file.
Added a link on the status item linking to the file that is importing a non existent file.
Added a link on the status item linking to the file that is importing a non existent file.
The link to the error location improves the UX, but to fully resolve the issue we need whole project diagnostics. |
Added a link on the status item linking to the file that is importing a non existent file.
Hey @JacobRhiel, if you make a further edit in the open editor does the validator starting message change? |
yes, on VSCode launch I got "Validation blocked - validator starting" and after editing a .sol file I got "Validation blocked - unable to load hardhat config" but the checkmark hardhat.config.js stayed |
@pemmenegger validation depends on being able to compile with hardhat. If the extension cannot read the |
Closing this since with |
As the title says, if at least 1 file has an invalid import (either relative or library import), the validation gets blocked for all files in the project. The expected behavior is that the diagnostic is shown for the file with the error, and other files are validated normally.
The text was updated successfully, but these errors were encountered: