← All errors · Next.js
Module not found: Can't resolve '...'
Exact error
Module not found: Can't resolve 'some-package'
What it means
The bundler could not locate an imported file or package.
Likely causes
- The package isn't installed (or is only installed locally, not in package.json).
- Wrong relative path or wrong letter case (works on macOS/Windows, fails on Linux/Vercel).
- A path alias like @/ not configured in tsconfig/jsconfig.
- A Node-only module (fs, path) imported into client code.
How to fix it
Install the package and make sure it is saved to package.json:
npm install some-packageCheck the exact file name casing matches the import. Linux filesystems are case-sensitive. To fix a case-only rename in git:
git mv components/button.tsx components/Button.tsxIf you use the @/ alias, confirm it exists:
// tsconfig.json { "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./*"] } } }Only import fs/path in server code (Server Components, route handlers, getStaticProps).
Related errors
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy