pnpm icon indicating copy to clipboard operation
pnpm copied to clipboard

`require.resolve` broken for modules within own workspace

Open runspired opened this issue 3 years ago • 1 comments

Given a package within a pnpm workspace with the name @org/pgk the following will fail with cannot find module. This works for both yarn 1 and npm's resolution.

require.resolve(`@org/pkg/src/main.ts`);

runspired avatar Sep 14 '22 20:09 runspired

Raised a similar issue in #5237, and I think non-pnp Yarn has the same issue?

xenobytezero avatar Sep 15 '22 11:09 xenobytezero