Module not found: Can't resolve './components/usercard'
Why it happens
The build works on your machine and fails on Vercel because of upper and lower case. Windows and macOS ignore case in file names. Vercel builds on Linux, where Header.tsx and header.tsx are two different files.
If you renamed a file by changing only its case, Git on those systems often does not record the change. Your import then points at a name the repository never got. A missing package or a wrong relative path gives the same message.
How to fix it
Open the failed deployment in the Vercel dashboard, go to Build Logs, and find the line that starts with Module not found. Copy the exact path it names.
Compare that path with the real file name as Git stores it, not with what your file explorer shows.
git ls-files | grep -i usercard
Make the import and the file name use the same case. If the file is components/UserCard.tsx, the import has to say ./components/UserCard.
If Git shows no change after you renamed a file, tell it to notice case, then rename through a temporary name and commit both steps together.
If the path in the log is a package name instead of a file, make sure it is in package.json and committed. A package installed only on your machine never reaches the build.
npm install package-name
Push and let Vercel build again. To reproduce the failure before you push, build from a clean copy of the repository.
git clone <your-repo-url> clean-copy
cd clean-copy && npm ci && npm run build
When it is not this
If the path in the log starts with @/ or ~/, the cause may be a path alias. An alias that works in your editor can still be missing from the build config.
If the clean copy builds fine but Vercel still fails, count the ../ parts of any relative path against the real folder depth.
Questions
Why does my import work locally but fail on Vercel?
Your computer probably ignores upper and lower case in file names. Vercel builds on a case-sensitive Linux filesystem, so an import with the wrong case points at a file that does not exist.
Does git config core.ignorecase false fix it on its own?
No. It only makes Git report case changes from now on. A rename Git already missed needs a two-step git mv through a temporary name.
The free health check asks ten questions about your app and shows the three fixes to do first. It runs in your browser.
If you would rather have someone read the code, the fixed-price audit is $497 one-time. It covers security and scaling, with a written report ranked by severity.