Windows developers running Hermes or other JavaScript runtimes through git-bash may have noticed files mysteriously disappearing after saving them to what looks like the correct location. If you've searched high and low for a file you know you created only to find nothing where it should be, there's a good chance you've stumbled into the MSYS2 phantom path bug—a quirk in how the MSYS2 environment translates POSIX-style paths on Windows filesystems.

What's Actually Happening

The root cause lies in MSYS2's path translation layer. When you run commands through git-bash and specify paths like /c/project/file.js, MSYS2 converts these to Windows-native paths for the underlying system calls. However, there's a known bug where certain operations can trigger creation of an actual folder literally named C:\c—complete with backslash and lowercase 'c'—and your files get written there instead of wherever you thought they were going.

Why Hermes Users Are Seeing This

Hermes, Facebook's JavaScript engine optimized for mobile, often gets invoked through build scripts that run in MSYS2/Git Bash environments on Windows. When Hermes writes compiled bytecode or temporary files during compilation, those file operations pass through the same broken path translation. The bug doesn't discriminate—it affects any tool writing files from bash contexts—but Hermes workflows happen to trigger it with enough frequency that it's become a known pain point.

How to Tell If You're Hit

Fire up File Explorer and navigate directly to C:\c (type it exactly: backslash, lowercase c). If that folder exists and contains your "missing" files, you've confirmed the bug. You won't see this folder from within git-bash because bash's path handling masks it—another reason this issue is so insidious.

The Fix

The most straightforward solution is to avoid MSYS2 path translation altogether by setting MSYS2_PATH_TYPE=strict in your environment variables before running build commands. This forces MSYS2 to pass paths through without translation, which fixes the phantom folder creation at its source. Alternatively, you can explicitly use Windows-style paths (C:\project\file.js) instead of POSIX paths (/c/project/file.js) when working with Hermes and similar tools on Windows.

Key Takeaways

  • The MSYS2 path translation layer creates a literal C:\c folder in certain conditions
  • Files written from git-bash can silently land in this phantom location
  • Setting MSYS2_PATH_TYPE=strict prevents the broken path translation
  • Using Windows-native paths instead of POSIX-style paths also sidesteps the issue

The Bottom Line

This is exactly the kind of cross-platform gotcha that makes Windows development with Unix tooling feel like walking through a minefield. If you're shipping Hermes-based apps from Windows, add MSYS2_PATH_TYPE=strict to your environment before you lose another afternoon wondering where your bundle files went.