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.

  1. Match exact case of filenames and directories in imports.
  2. Configure resolve.extensions and alias in the bundler config.
  3. 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

  1. Align paths with the filesystem

    1. Match exact case of filenames and directories in imports.
    2. Configure resolve.extensions and alias in the bundler config.
    3. Clear build caches (.next, node_modules/.cache) after refactors.

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.

Still stuck? Try these related fixes next.

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'
Fix another errorHTTP status codesURL status checkerRedirect checkerAll tools