berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug?]: pnpm linker does not preserve name of package directory

Open kherock opened this issue 3 months ago • 0 comments

Self-service

  • [ ] I'd be willing to implement a fix

Describe the bug

Certain packages seem to care about the name of the folder that they reside in (namely Next.js).

For example, I get this error while trying to build my site with Next.js 14:

Error: Invariant: Expected relative import to start with "next/", found "package/dist/server/future/route-modules/pages/module.compiled"

To reproduce

This should be reproducible on any Next.js project with the pnpm linker enabled. In case it matters, I am using the pages router still.

Environment

System:
    OS: macOS 13.6.4
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 20.12.1 - /private/var/folders/9f/kl_c86q5651fqmhmzf63jb0x5t_d9j/T/xfs-bad117dc/node
    Yarn: 4.2.1 - /private/var/folders/9f/kl_c86q5651fqmhmzf63jb0x5t_d9j/T/xfs-bad117dc/yarn
    npm: 10.5.0 - /opt/homebrew/bin/npm

Additional context

No response

kherock avatar May 03 '24 01:05 kherock