Error fix
How to fix “Module not found (webpack / bundler)”
The bundler could not resolve a file path—case sensitivity, extension, or missing file on disk.
Updated Apr 20, 2026
Tools that help with this
Fastest fix
Start here first. Step 1 fixes most cases—then work down the list.
- Match exact case of filenames and directories in imports.
- Configure resolve.extensions and alias in the bundler config.
- Clear build caches (.next, node_modules/.cache) after refactors.
Why this works
These steps work because it clears stale cached state that can cause the same request to fail repeatedly.
What this means
At build time, webpack/vite could not map an import to a file. Runtime module errors differ.
Common causes
Case and path
Imports use different casing than files; Linux CI fails while macOS passes.
Missing file
Rename without updating imports or git ignore excluding files.
Step-by-step fix
Align paths with the filesystem
- Match exact case of filenames and directories in imports.
- Configure resolve.extensions and alias in the bundler config.
- Clear build caches (.next, node_modules/.cache) after refactors.
Related
FAQ
- CI only?
- Linux filesystems are case-sensitive—normalize names once.
- Monorepo packages?
- Check transpilePackages / workspace:* resolution in Next.js.
- Dynamic import?
- Some patterns need explicit chunk names or context limits.
Fix related issues
Still stuck? Try these related fixes next.
- Git merge conflictTwo branches edited the same lines; Git stopped for manual resolution.
- ESLint parsing errorThe file isn’t valid for the parser—wrong parser, JSX in .ts, or stage-3 syntax without plugin.
- TypeScript cannot find nameA symbol is used without a declaration or import—typo, missing import, or wrong tsconfig scope.
- Missing package.json fileNode/npm expected a package.json in this folder—the project root is wrong or the file was never created.
- Axios network error (browser)Axios could not reach the server—no response object; often CORS, TLS, or offline.
Edit your error
Tweak the message and run again—we'll match an existing fix or generate a new page.
Original error message
Module not found: Can't resolve './Component'
