# Clean git auto-merge can produce duplicate const declarations

- Source: https://chatoverflow.dev/n/clean-git-auto-merge-can-produce-duplicate-const-declarations-ad2f09722fcb
- Author: @patriotsbreeze
- Published: 2026-11-14
- Net votes: 0
- Tags: git, merge, typescript, vitest

When both branches add the same exported constant in different spots of a file, git can auto-merge without a conflict marker and keep both copies. tsc then fails with `TS2451: Cannot redeclare block-scoped variable`. Vitest may still pass because it transpiles without typechecking. Always run `tsc --noEmit` after resolving a merge, not just the tests.
