Skip to content

Windows: app typecheck fails with core.symlinks=false #64088

Done

Description

@natricknye

Description

With core.symlinks=false, git checks out packages/app/src/custom-elements.d.ts as a text file containing the link target. cd packages/app && bun run typecheck then fails:

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

The file is a symlink (git mode 120000) to packages/ui/src/custom-elements.d.ts. TypeScript parses the target path as code.

This still reproduces on dev at 33aefad13c54cd0276e46eb862f67365bce8c770. With the same commit and core.symlinks=true, the package typecheck passes. This is the only TypeScript symlink left on dev; the other symlinks are assets.

Plugins

None.

OpenCode version

dev at 33aefad13c54cd0276e46eb862f67365bce8c770 (2.2.7).

Steps to reproduce

  1. On Windows, clone the repo with core.symlinks=false.
  2. bun install
  3. cd packages/app && bun run typecheck

Screenshot

Not applicable; the output is the two errors above.

Operating System

Windows 11.

Terminal

PowerShell 5.1.

Activity

  1. added
    area/web
    type/bug
    version/v2
    on Nov 15, 2026
  2. opencodejr commented on Nov 15, 2026

    @opencodejr
    Contributor

    Thanks for the clear report. I reproduced this on the latest dev (d432a06). packages/app/src/custom-elements.d.ts is the same symlink there as at 33aefad.

    Steps (on Linux, where core.symlinks=false behaves the same as the Windows default), with Bun 1.4.4:

    1. Run bun install, then git config core.symlinks false.
    2. Check the file out again: it becomes a regular file whose only content is ../../ui/src/custom-elements.d.ts.
    3. Run cd packages/app && bun run typecheck. It fails with the same two errors:
      src/custom-elements.d.ts(1,1): error TS1128: Declaration or statement expected.
      src/custom-elements.d.ts(1,2): error TS1128: Declaration or statement expected.
      
    4. With core.symlinks=true, the same command reports no type errors in 2,407 files.

    The script below runs both cases. Your PR #63570 proposes a fix, and earlier reports of the same cause are #13397 and #25564.

    Reproduction script (repro.sh)
    #!/usr/bin/env bash
    # Reproduces #64088: packages/app typecheck fails when git checks out
    # symlinks as plain text files (core.symlinks=false, the Windows default).
    # Run from an opencode checkout (default: /workspace/repo) after `bun install`.
    set -u
    echo "bun: $(bun --version)"
    REPO="${1:-/workspace/repo}"
    cd "$REPO"
    F=packages/app/src/custom-elements.d.ts
    echo "commit: $(git rev-parse HEAD)"
    echo "index entry: $(git ls-files -s $F)"
    
    run_typecheck() {
      (cd packages/app && bun run typecheck 2>&1 | grep -E "custom-elements|error" | head -5; echo "exit: ${PIPESTATUS[0]}")
    }
    
    echo "== core.symlinks=false =="
    git config core.symlinks false
    rm -f "$F" && git checkout -- "$F"
    echo "file type: $(stat -c %F "$F")"; echo "content: $(cat "$F")"
    run_typecheck
    
    echo "== core.symlinks=true =="
    git config core.symlinks true
    rm -f "$F" && git checkout -- "$F"
    echo "file type: $(stat -c %F "$F")"
    run_typecheck
    git config --unset core.symlinks

    Run it: bash repro.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/webplatform/windowsreproducedtype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions