Turbopack Error: Next.js package not found #78497
Replies: 3 comments
-
In a Turborepo-powered monorepo, running the Next.js app with Turbopack (via next dev --turbopack) will fail with a “Next.js package not found” error if there is a pnpm-lock.yaml file inside that app’s directory (e.g. apps/web/pnpm-lock.yaml). Removing the stray pnpm-lock.yaml from apps/web immediately resolves the issue. |
Beta Was this translation helpful? Give feedback.
-
I had to remove the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the report! This error usually happens when Turbopack determined your project’s root directory based on a lockfile that exists further down the filesystem than where next is installed. For example, something like this:
Here, Turbopack determined the root directory to be You’ll need to either:
We’re working on a better way of communicating this problem, and exploring other approaches where the root directory can be better discovered automatically. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Turbopack version:
v15.3.0-canary.45-23-g664110c18
Error message:
Beta Was this translation helpful? Give feedback.
All reactions