# "Module not found: Can't resolve './components/header'" on Vercel or Netlify, but it builds on your computer

- Fix ID: APP-13
- Exact error: `Module not found: Can't resolve './components/header'`
- Status: Manually verified (CI: pending, no CI results exist yet)
- Last verified: 2026-10-26
- Platforms: Vercel, Netlify, Cursor, Bolt, Lovable
- Versions: os=Debian 13 (container); node=20.19.2; vite=8.3.5 (react-ts template); git=2.47.3
- Repro: https://stucktoshipped.com/repros/APP-13/ (file hashes only; files are in the paid repro bundle)
- Canonical: https://stucktoshipped.com/fixes/vercel/module-not-found-filename-casing/

## In brief
Linux build servers are case-sensitive and your Mac or PC isn't. The full fix shows how to find the mismatch and the git-safe way to rename a file when git ignores case-only changes.

## Symptom
You built the app on a Mac or Windows PC with Cursor, or exported it from Bolt or Lovable. `npm run build` works on your machine, but the Vercel or Netlify build fails with one of these:

```
Module not found: Can't resolve './components/header'                (Next.js / webpack)
[UNRESOLVED_IMPORT] Could not resolve './components/header' in src/App.tsx   (Vite)
error TS2307: Cannot find module './components/header' or its corresponding type declarations.
```

## Why it happens
- **Upper and lower case.** Macs and Windows treat `Header.tsx` and `header.tsx` as the same file by default. Vercel and Netlify build on Linux, where they are **different files**.
- **A sneakier version:** you renamed `header.tsx` to `Header.tsx` in Finder or Explorer. Git on a Mac or Windows usually doesn't notice a case-only rename, so GitHub still has `header.tsx`.

## What we could not test
- A real Mac or Windows machine (the "builds locally" side and git's real `core.ignorecase`). Our attempt to fake it on Linux behaved differently and is marked not faithful in the repro.
- Real Vercel or Netlify builds, and the exact Next.js/webpack wording.

## Full fix (paid)
The step-by-step fix, commands and test record are paid content and are not in this file. Price: $4 per fix (planned launch price; checkout not open yet). SHA-256 of the full fix: d481431a2afea25e765b2dd6eaefd78a36cc83d3a8d5d23e9d57e612461a9d31. How to buy: https://stucktoshipped.com/pricing/ and https://stucktoshipped.com/products.json

## Sources
- [Vercel KB: How do I resolve a 'module not found' error?](https://vercel.com/kb/guide/how-do-i-resolve-a-module-not-found-error)
- [Stack Overflow: Next.js build error on Vercel but not in local](https://stackoverflow.com/questions/72421143/next-js-build-error-on-vercel-but-not-in-local)
- [Vercel community: Module not found for existing file with correct casing](https://community.vercel.com/t/module-not-found-for-existing-file-with-correct-casing/14128)
- [next.js discussion 57507](https://github.com/vercel/next.js/discussions/57507)

## How this page was made
Drafted by an AI agent and reproduced on our test machine on 2026-10-26. No warranty; test on a copy first.
