Skip to content

fix: rename type declaration so the repo can be cloned on Windows - #569

Closed
eeshsaxena wants to merge 1 commit into
bugbakery:mainfrom
eeshsaxena:fix/windows-invalid-filename
Closed

fix: rename type declaration so the repo can be cloned on Windows#569
eeshsaxena wants to merge 1 commit into
bugbakery:mainfrom
eeshsaxena:fix/windows-invalid-filename

Conversation

@eeshsaxena

Copy link
Copy Markdown

Problem

frontend/src/types/virtual:git-version.d.ts contains a colon. That is not a legal filename character on NTFS (it's the alternate-data-stream separator), so the repository cannot be cloned on Windows at all:

$ git clone https://github.com/bugbakery/transcribee.git
error: invalid path 'frontend/src/types/virtual:git-version.d.ts'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.

It isn't just the checkout: git can't write that index entry either, so the usual escape hatches don't help - git sparse-checkout set backend worker followed by git reset --hard still fails with the same error, and so does git checkout HEAD -- .. In practice a Windows contributor can clone the bare objects and nothing else.

Fix

Rename the file to frontend/src/types/git-version.d.ts. Contents are unchanged (same blob), so this is a pure rename.

That's safe because the filename carries no meaning here:

  • What registers the module is the declare module 'virtual:git-version' inside the file, not what the file is called. The name was just mirroring the virtual module id.
  • frontend/tsconfig.json uses "include": ["src"], so the declaration is picked up by directory glob regardless of filename.
  • Nothing references the path. frontend/src/components/footer.tsx does import version, { Commit } from 'virtual:git-version' (the module id) and frontend/vite.config.js declares const virtualModuleId = 'virtual:git-version' - both are the module id, which this PR does not touch.

After this change no tracked path in the repo contains a colon, so a plain git clone works on Windows.

A note on how this was made

Slightly unusual: because the offending path can't be written to the index on Windows, I couldn't git mv it locally. The commit was created through the GitHub git-data API (new tree from main with the blob re-pointed and the old path removed), which is why it lands as a single clean rename. GitHub's own compare view confirms it: renamed ... (+0/-0), 1 commit.

I don't have a Windows-free environment to run the frontend build in, so I haven't executed pnpm build against the rename - though since the blob is byte-identical and resolution is by module id + include: ["src"], there's nothing for it to change. Happy to adjust the filename if you'd prefer a different convention (e.g. virtual-git-version.d.ts to keep the association visible).

frontend/src/types/virtual:git-version.d.ts contains a colon, which is not a
legal filename character on NTFS. Cloning on Windows fails outright:

    error: invalid path 'frontend/src/types/virtual:git-version.d.ts'
    fatal: unable to checkout working tree

git cannot even write that index entry, so sparse-checkout and git reset fail
as well - a Windows contributor cannot check the repository out at all.

The colon in the filename is only a convention mirroring the virtual module
id; it has no meaning to the compiler. Resolution comes from the
declare module 'virtual:git-version' inside the file, and tsconfig.json picks
it up via "include": ["src"], so the file name is irrelevant. Nothing refers
to the path either - footer.tsx imports the module id and vite.config.js
defines it - so the rename is behaviour-preserving. The file contents are
unchanged (same blob).
@eeshsaxena eeshsaxena closed this Jul 16, 2026
@eeshsaxena eeshsaxena reopened this Jul 16, 2026
@anuejn

anuejn commented Jul 17, 2026

Copy link
Copy Markdown
Member

hey,
how were LLMs used in the creation of this PR?
As per our contribution guidelines, we do not accept contributions that were fully or in parts generated by so-called generative ai.

@eeshsaxena

Copy link
Copy Markdown
Author

No LLMs were used in the creation of this PR. I ran into the bug manually when trying to clone the repo on Windows, and I pushed the fix myself via the GitHub API since local git mv operations were blocked , Used an AI tool to help format the PR description for clarity

@phlmn

phlmn commented Jul 29, 2026

Copy link
Copy Markdown
Member

Closing this since it violates our AI policy.
Will be fixed with #598

@phlmn phlmn closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants