jsonvisual-studio-codelualua-5.4

VSCode: "No debug adapter, can not send 'evaluate'"


I am trying to run lua 5.4 code in VSCODE but I am getting this error:No debug adapter, can not send 'evaluate'. My debugger is "Local Lua Debugger" and the launch.json is

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lua-local",
            "request": "launch",
            "name": "Launch",
            "program": {
                "lua": "lua54",
                "file": "bot.lua"
            
            }
        }
    ]
}

And the lua file itself is

print("Y/N?")
local input = io.input()
if input  == "no" then
    print("yes")
end

The error shows up every time I want to input something.


Solution

  • io.input() is for you to read external files, in it you pass the path of a file you want to read.

    If you want to write something and store it in the variable, try using io.read()