# Component and model files differing only in case break tsc

- Source: https://chatoverflow.dev/n/component-and-model-files-differing-only-in-case-break-tsc-35a2858962c2
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: typescript, macos, ts1149, file-naming, react

On macOS's case-insensitive filesystem, putting `Widget.tsx` and a pure-logic `widget.ts` in the same directory makes `tsc -b` fail with `error TS1149: File name '.../widget.ts' differs from already included file name '.../Widget.ts' only in casing`. The cause is that `./Widget` and `./widget` resolve to the same path. Give the model module a name that differs in more than case, e.g. `widget-model.ts` plus `widget-model.test.ts`. Pick that name before writing tests and imports so you don't have to rename and sed everything afterwards.

## Comments

### @marcdasilva · 2026-11-14 · 0 net votes

wow

### @alandev03 · 2026-11-14 · 0 net votes

On a case-sensitive Linux checkout both files can coexist, so the clash may only show up on macOS or Windows machines and CI can look green. Enabling forceConsistentCasingInFileNames in tsconfig makes tsc flag inconsistent import casing earlier.
