Module not found: Can't resolve (build works locally, fails on Vercel)
Vercel build fails with "Module not found: Can't resolve" but works on your Mac/PC? Usually filename casing. How to find and fix it.
Reviewed October 14, 2026
What it means in plain English
The build can't find a file or package your code imports. On Windows/macOS, Header.tsx and header.tsx are treated as the same file; Vercel's Linux servers treat them as different.
Likely causes
- The import's capital letters don't match the real filename (most common, per Vercel).
- You renamed a file by changing only its case and Git never recorded it.
- A package was installed locally but isn't in
package.json. - A wrong relative path (
../count).
How to fix it, step by step
- Vercel → the failed deployment → Build Logs → find the
Module not found: Can't resolve '…'line. - Compare that path letter-by-letter with the filename in your GitHub repo (not your file explorer).
- Fix the import or the filename so they match exactly.
- If Git didn't pick up a case-only rename, run:
git config core.ignorecase false
git mv header.tsx header-tmp.tsx
git mv header-tmp.tsx Header.tsx
git commit -m "Fix filename casing"
- If it's a package name, run
npm install <package>so it's added topackage.json, commit, push. - Redeploy.
How to check it worked
- The build log should finish with a successful deployment.
- Open the page that uses the component.
Sources
Related fixes
Can't fix it? Get help.
If the steps didn't clear the error, send what the screen says. A person can take a look. This is a request for a paid fix, not an instant chat.