Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Unexpected workspaceFolder mount behavior when dev container is opened before Git initialization

Ouverte
#1,055 2 commentaires 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@v-Kaniska244 y travaille déjà.

Depuis le 6/8/2025.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

I've encountered a strange and hard-to-debug behavior when using multiple devcontainer.json files in a monorepo setup.

Steps to Reproduce
  1. Create a new directory (not yet initialized as a Git repository).
  2. Add a .devcontainer folder in the root with multiple devcontainer.json files, each specifying a different workspaceFolder to scope the dev container to a project in the monorepo.
  3. Open one of the devcontainers in VS Code before initializing the root directory as a Git repository.
  4. Observe that the workspace folder is mounted incorrectly — the parent folder is mounted instead of the expected project directory.
  5. Now run git init in the root of the repo.
  6. Reopen the devcontainer. Everything now works as expected, with the workspaceFolder correctly mounted.
🧠 Expected Behavior

The specified workspaceFolder should be mounted correctly, even if the root directory hasn't been initialized as a Git repository.

😕 Actual Behavior

Before Git initialization, the mount behavior is incorrect — it mounts the parent directory instead of the specified workspaceFolder. This is confusing and difficult to diagnose.

💥 Impact

This behavior makes it hard to use dev containers in new projects or automation scripts that generate dev containers before initializing Git. It also leads to unexpected mount paths, which can break tooling, scripts, or assumptions about paths inside the container.

✅ Suggested Fix

The logic determining the workspaceFolder mount should not depend on whether the folder has been initialized as a Git repository. If Git initialization is required for some internal behavior, it should at least produce a warning or fallback gracefully.


Let me know if you'd like logs or a minimal repro repo — happy to provide more detail if needed.

Langage dominant
TypeScript
Étoiles
3k
Forks
462
Merge moyen
13 h 28 min
PR mergées (30 j)
2

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de devcontainers/cli

Toutes les issues de devcontainers/cli

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.