vscode-solidity icon indicating copy to clipboard operation
vscode-solidity copied to clipboard

Source file requires different compiler version

Open tifrel opened this issue 3 years ago • 1 comments

By now I have tried a multitude of options and compiler versions, but the extension keeps complaining about a version mismatch, where it should not:

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.3;

contract Box {
  // irrelevant
}

Which yields following error message:

Source file requires different compiler version (current compiler is 0.8.6+commit.11564f7e.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version

My settings.json:

  "solidity.defaultCompiler": "localNodeModule",
  "solidity.compileUsingRemoteVersion": "v0.7.3+commit.9bfce1f6",
  "solidity.nodemodulespackage": "[email protected]",

npm packages:

$ npm ls solc
hardhat-sandbox@ /<path>
└─┬ [email protected]
  └── [email protected]

Any ideas?

tifrel avatar Sep 22 '21 10:09 tifrel

@tifrel please use the context menu to set the version of your workspace or global image

juanfranblanco avatar Sep 28 '21 13:09 juanfranblanco