What it means
The build can't find a file or package your code imports.
Why AI tools cause it
Three usual suspects:
- Letter case. Your import says
./components/Buttonbut the file isbutton.tsx. Mac and Windows ignore case; the Linux servers your host builds on don't. - A package that isn't installed. The AI wrote an import but never added the package to
package.json. - A file that was never committed, so it exists on your machine but not in your repo.
The fix
- Read the error: it names the exact import that failed.
- Check the file name's capital letters match the import exactly. To rename only the case in git, use
git mv button.tsx Button.tsx. - If it's a package, install it (
npm install <name>) and commitpackage.jsonand the lock file. - Run
git statusto check nothing important is uncommitted.
Paste this into your AI
My deploy fails with "Module not found: Can't resolve
". Check every import in this project matches the real file name, including capital letters, and list any imported packages missing from package.json.
Still broken?
Clear your host's build cache and redeploy.