#getting module not found error

1 messages · Page 1 of 1 (latest)

native solsticeBOT
#

Hi @lusty apex. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

In Next.js 16, the default bundler changed to Turbopack, and a number of users are seeing “Module not found: Can’t resolve …” errors after adding or changing packages, even though the packages are installed correctly. [Upgrade to 16]

From the issues in the knowledge sources, this can happen when:

Because of this, the same code often works with Webpack but fails with Turbopack. [Turbopack vs webpack; downgrading fixes]

What you can try

  1. Confirm it’s a Turbopack issue by using Webpack

    Temporarily opt out of Turbopack:

    {
      "scripts": {
        "dev": "next dev --webpack",
        "build": "next build --webpack",
        "start": "next start"
      }
    }
    
#

If the error disappears with --webpack, you’re hitting one of the known Turbopack resolution problems. [Upgrade to 16; workaround]

  1. If you’re using local / workspace packages

    Be aware that several reports show Turbopack not resolving them even though Webpack does. [Local package fail; file: dependency; monorepo sibling]
    In that case, continuing with Webpack (--webpack) is currently the reliable workaround.

  2. If you’re deploying on Vercel

    A “module not found” at build time usually means the static import path can’t be resolved by the bundler, even if the package is installed. [Other build errors]
    Again, switching the build to next build --webpack is a known workaround while Turbopack issues are being resolved. [Upgrade to 16]


The knowledge sources don’t explain why your editor “recommendations” (likely IntelliSense / auto-imports) stopped, so I can’t answer that part confidently. They only cover the build-time “module not found” behavior with Turbopack. If you share the exact error message and how you’re importing the new packages (normal dependency vs local workspace, etc.), I can map it more precisely to the known issues above.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@lusty apex Kapa.ai is still learning and improving, please let me know how I did by reacting below.