Not working with Yarn pnpm strategy #65757
Labels
bug
Issue was opened via the bug report template.
Module Resolution
Module resolution (CJS / ESM, module resolving)
Runtime
Related to Node.js or Edge Runtime with Next.js.
Link to the code that reproduces this issue
https://github.com/coreyward/next-yarn-pnpm-issue
To Reproduce
Run
yarn dev
in the linked repo root, then open the app at localhost:3000. This will trigger the following error:Current vs. Expected behavior
Next works fine when using the legacy
node_modules
approach for installing dependencies, and seems to have support for the Plug-N-Play strategy of pnpm, but it does not seem to account for Yarn’s hybridpnpm
strategy which is described as follows:The issue seems to come about in the load-entrypoint, which seems to make unsafe assumptions about where dependencies are located on disk relative to the project. The specific error is coming from Next.js here:
next.js/packages/next/src/build/load-entrypoint.ts
Lines 63 to 70 in 9d16112
Provide environment information
Which area(s) are affected? (Select all that apply)
Module Resolution, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
This may be related to #16471.
The text was updated successfully, but these errors were encountered: