devpod icon indicating copy to clipboard operation
devpod copied to clipboard

Plain `.devcontainer.json` contains empty `build` key

Open luebken opened this issue 1 year ago • 1 comments

What happened? For a simple Javascript project like https://github.com/luebken/hello-nodejs the built-in language detection creates the following .devcontainer.json:

{"image":"mcr.microsoft.com/devcontainers/javascript-node","build":{}}

When opening the code the following warning is shown VSCode:

Property build is not allowed.

What did you expect to happen instead? I expect .devcontainer.json to only contain the image key, so no warning is shown.

How can we reproduce the bug? (as minimally and precisely as possible)

Local Environment:

  • DevPod Version: v0.1.9
  • Operating System: mac
  • ARCH of the OS: ARM64

DevPod Provider:

  • Local/remote provider: docker

Anything else we need to know? From my understanding, the issue here is how Go marshals nested structs, which is how the ConfigBuildOptions are defined: https://github.com/loft-sh/devpod/blob/main/pkg/devcontainer/config/config.go#L215

luebken avatar Jun 21 '23 12:06 luebken

@luebken thanks for creating this issue! You are correct, we should fix this, thanks for the analysis.

FabianKramm avatar Jun 21 '23 16:06 FabianKramm

should be fixed, not sure why we didn't link the PR #702

pascalbreuninger avatar Apr 17 '24 19:04 pascalbreuninger