Error when added features in devcontainer.json #45812
Unanswered
uyriq
asked this question in
Codespaces
Replies: 4 comments 3 replies
-
You're wrapping features in an extra set of braces. {
"name": "Node.js",
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-18",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-contrib/features/redis-homebrew:1": {}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
Sorry for typo but, my devcontainer.json is normal way created with vscode extension and there are not extra {} pair . error log said it a permission erorr, is not it?
fatal: not in a git directory |
Beta Was this translation helpful? Give feedback.
2 replies
-
The error is likely due to incorrect JSON formatting. Here's a corrected version: {
"name": "Node.js",
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-18",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-contrib/features/redis-homebrew:1": {}
},
"forwardPorts": [
3001,
6379
],
"postCreateCommand": [
"yarn install",
".devcontainer/postCreateCommand.sh"
],
"customizations": {},
"remoteUser": "root",
"postAttachCommand": ".devcontainer/postAttachCommand.sh"
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
Does this error only happen during prebuilds? Are you able to create a codespace with this devcontainer.json? I also see
Which might be a clue as to why it is failing in the prebuild. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
I don't know how to get rid of the error when creating a container
When adding any features to devcontainer.json, this error occurs. The correct build is only possible with empty field "features": {}
I tried delete and rebuild, rebuild always get safe mode.
Beta Was this translation helpful? Give feedback.
All reactions