microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.66k stars 286 forks source link

Attached container config: Protect against syntax errors in config #2689

Open Yvand opened 4 years ago

Yvand commented 4 years ago

Hello, Since I updated Docker Desktop to 2.2.0.5(43884), "Dev Containers" terminal reports the following error when I try to open a folder in a running container:

[0 ms] Start: Resolving remote
[1 ms] Setting up container azfunc-node

[19 ms] Error: Can not add index to parent of type property
        at m (c:\Users\yvand\.vscode\extensions\ms-vscode-remote.remote-containers-0.106.0\dist\extension.js:1:52999)
        at Module.R (c:\Users\yvand\.vscode\extensions\ms-vscode-remote.remote-containers-0.106.0\dist\extension.js:1:57710)
        at c:\Users\yvand\.vscode\extensions\ms-vscode-remote.remote-containers-0.106.0\dist\extension.js:1:1049226

The exact steps are the following:

I use image mcr.microsoft.com/vscode/devcontainers/typescript-node:12. I tried to create a new container from this image but the error is the same

Docker Desktop 2.2.0.5(43884) ms-vscode-remote.remote-wsl Version: 0.42.4

VSCode: Version: 1.43.2 (user setup) Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50 Date: 2020-03-24T07:38:38.248Z Electron: 7.1.11 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18363

chrmarti commented 4 years ago

Could you attach the config you get when you run F1 > Remote-Containers: Open Container Configuration File while attached?

Yvand commented 4 years ago

Thank you for your hint, it was the cause of the issue. Configuration was not valid:

{
    "workspaceFolder": "/data/dockerdev/azure-sdk-for-js",
    "extensions": [
        "dbaeumer.vscode-eslint",
        "ms-azuretools.vscode-azurefunctions",
        "ms-vscode.azure-account"
    ]"ms-vscode.azure-account"
    ]
}

I fixed the the syntax issue and it resolved the problem:

{
    "workspaceFolder": "/data/dockerdev/func-githubRepoStats",
    "extensions": [
        "dbaeumer.vscode-eslint",
        "ms-azuretools.vscode-azurefunctions",
        "ms-vscode.azure-account"
    ]
}
avendiart commented 4 years ago

Had the same issue today, it occurred when I tried to run code /workspace/dir-2 inside vscode terminal with /workspace/dir-1 being currently open in container. When I ran Remote-Containers: Open Container Configuration File configuration file looked like this:

{
    "workspaceFolder": "/workspace/dir-1",
    "extensions": [
        "42Crunch.vscode-openapi",
        "dbaeumer.vscode-eslint",
        "donjayamanne.githistory",
        "redhat.vscode-yaml"
    ]y",
        "redhat.vscode-yaml"
    ]
}
Version: 1.46.1
Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
Date: 2020-06-17T21:17:14.222Z (6 days ago)
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.5.0