GUIDES · BROKEN IMPORTS

Module not found on Vercel: missing packages and case sensitive imports

The import resolves on macOS and fails on Vercel with Module not found. Why Linux cares about casing, how to find the mismatch, and how to rename a file by case in git.

The error

Module not found: Can't resolve ./components/Header in /vercel/path0/app. The file exists in the repository as header.tsx. On macOS and Windows the default file systems ignore case, so the import works. Vercel builds on Linux, where Header.tsx and header.tsx are different files.

Find every mismatch

Clone the repository on Linux, or in a Docker container, and run the build. Or scan the repository with a tool that compares each relative import against the real file tree. The same class of bug hides in dynamic imports and in paths listed in next.config.

Rename a file by case in git

git mv Header.tsx header.tsx is a no op on a case insensitive disk. Rename through a temporary name so git records the change.

git mv components/header.tsx components/header-tmp.tsx
git mv components/header-tmp.tsx components/Header.tsx
git commit -m "Match import casing"

Prevent it

Set core.ignorecase to false in the repository, and add a lint rule or a CI job that builds on Linux before merging. Scanning the repository before every push catches it earlier than CI does.

Error reference: What it means

Windows and macOS use case-insensitive file systems by default, so Header.tsx and header.tsx are the same file there. Vercel builds on a case-sensitive Linux file system, where they are two different paths. Vercel's guide calls a casing mismatch the almost-always cause of this error.

Git can hide the problem: on a case-insensitive system it often does not record a rename that only changes letter case.

Error reference: How to fix it

1. In the failed deployment's Build Logs, find the Module not found line and note the import path it names.

2. Compare that path character by character with the real file name in the repository, not in your local file explorer.

3. Make the import and the file name use the same casing, commit and redeploy.

4. If Git never recorded the rename, rename through a temporary name so Git sees an explicit change. Commit both steps together.

5. If the unresolved path is a package name, confirm the package is listed in package.json and committed.

6. If the path is relative, count the ../ segments against the file's real folder depth. An editor with path aliases can hide a wrong path.

git config core.ignorecase false
git mv header.tsx header-tmp.tsx
git mv header-tmp.tsx Header.tsx

What the repository scan cannot verify

The broken imports check reports relative, @/ and tsconfig alias imports that point to files missing from the repository, including files that differ only by letter case. The dependencies check reports imported packages that are not declared in package.json. A scan reads the repository on GitHub, so it cannot confirm that your build passes.

Sources

Updated 2026-11-15