Error when added features in devcontainer.json #45812
Replies: 5 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.
-
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.
-
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.
-
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.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
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