Open 3esmit opened 1 year ago
Agreed. We should enhance the warning message to give guidance to WSL users.
The platform specific elements of Hardhat, and our use of hardhat during validation of hardhat projcts, force the requirement of running the extension in WSL.
We should update the docs to reflect this as well, and give a more detailed explanation of the constraint.
Hardhat version: 2.16.1 NPM 9.7.2 Node Version: v18.16.1 OS: Windows 11 for VSCode, but using WSL 2 with Ubuntu 22.04 for project
I had tried doing what the error message says (delete node_modules and package-lock.json, and reinstall project) but it didn't helped.
npx hardhat compile
works fine, this issue is just on the vscode extension. Its not related to the project, its related to WSL project vs Windows VScode. When I run npm install, its on a WSL console, but VSCode is running on the native Windows OS, therefore the platform specific modules are installed for Linux, but when hardhat-vscode tries to run them, they conflict because its being ran in Windows.If you are also having this problem, there is an workaround:
/mnt/c/Users/<your-user>/<your-project-folder>/
on WSL VSCodeIf this is not going to be fixed, at least the HH18 error message should include this information: "If you are running on WSL, you should use also VSCode on WSL"