BUG: Git symlinks break TypeScript pre-push hooks on Windows #9217

Closed
opened 2026-02-16 18:11:55 -05:00 by yindo · 1 comment
Owner

Originally created by @mynameistito on GitHub (Feb 12, 2026).

Originally assigned to: @rekram1-node on GitHub.

Problem

Pre-push hooks fail on Windows with TypeScript errors in symlinked .d.ts files:

src/custom-elements.d.ts(1,1): error TS1128: Declaration or statement expected.

Root Cause

  • Git stores symlinks with mode 120000 in the index
  • git config core.symlinks defaults to false on Windows
  • When disabled, git writes symlinks as plain text files containing the target path string
  • TypeScript reads this text as code instead of following the symlink

Affected Files

  • packages/app/src/custom-elements.d.ts../../ui/src/custom-elements.d.ts
  • packages/enterprise/src/custom-elements.d.ts../../ui/src/custom-elements.d.ts

Workaround

Run these commands on Windows after cloning:

git config core.symlinks true
git restore packages/app/src/custom-elements.d.ts
git restore packages/enterprise/src/custom-elements.d.ts

Requires: Windows Developer Mode enabled OR running terminal as Administrator.

Proposed Solution

Add a postinstall script that automatically configures git symlinks on Windows.

Originally created by @mynameistito on GitHub (Feb 12, 2026). Originally assigned to: @rekram1-node on GitHub. ## Problem Pre-push hooks fail on Windows with TypeScript errors in symlinked `.d.ts` files: ``` src/custom-elements.d.ts(1,1): error TS1128: Declaration or statement expected. ``` ## Root Cause - Git stores symlinks with mode `120000` in the index - `git config core.symlinks` defaults to `false` on Windows - When disabled, git writes symlinks as plain text files containing the target path string - TypeScript reads this text as code instead of following the symlink ## Affected Files - `packages/app/src/custom-elements.d.ts` → `../../ui/src/custom-elements.d.ts` - `packages/enterprise/src/custom-elements.d.ts` → `../../ui/src/custom-elements.d.ts` ## Workaround Run these commands on Windows after cloning: ```bash git config core.symlinks true git restore packages/app/src/custom-elements.d.ts git restore packages/enterprise/src/custom-elements.d.ts ``` **Requires**: Windows Developer Mode enabled OR running terminal as Administrator. ## Proposed Solution Add a postinstall script that automatically configures git symlinks on Windows.
yindo added the windowsneeds:compliance labels 2026-02-16 18:11:55 -05:00
yindo closed this issue 2026-02-16 18:11:55 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 12, 2026):

This issue doesn't fully meet our contributing guidelines.

What needs to be fixed:

  • This issue uses a custom format instead of one of our required templates (Bug Report, Feature Request, or Question)
  • Please use the Bug Report template and ensure it includes all required fields

Please edit this issue to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions[bot] commented on GitHub (Feb 12, 2026): <!-- issue-compliance --> This issue doesn't fully meet our [contributing guidelines](../blob/dev/CONTRIBUTING.md). **What needs to be fixed:** - This issue uses a custom format instead of one of our required templates (Bug Report, Feature Request, or Question) - Please use the **Bug Report** template and ensure it includes all required fields Please edit this issue to address the above within **2 hours**, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9217