couldn't find a debug adapter descriptor for debug type 'solidity'(Extension might have failed to activate)

Viewed 1424

I'm trying to run a simple code in VScode.

// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.0;

import "hardhat/console.sol";

contract WavePortal {
    constructor() {
        console.log("Yo yo, I am a contract and I am smart");
    }
}

And as i try to compile the code, it shows the following error

Click to open the error

This is my launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "solidityMeadow",
            "request": "launch",
            "name": "Debug Solidity (via unit test run)"
        },
        {
            "type": "solidity",
            "request": "launch",
            "name": "Debug Solidity (via contract entry point)"
        },
        {
            "type": "solidity",
            "request": "launch",
            "name": "Debug Solidity"
        }
    ]
}
2 Answers

Try reinstalling your extension. This is a known error. Happened after last VSCode upgrade.

no idea if help is still needed. But in case someone finds this post. I had the same problem. But then I fixed it for me. What I did was to install the extension "Blockchain Development Kit for Ethereum" in VSCode. Then just create a new project using CTRL+SHIFT+P and type in "Blockchain:". Choose the option "Create a Solidity Project". Should fix this error.

Related