berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug?]: `injectEnvironmentFiles` are not set when loading yarn with PnP

Open smcenlly opened this issue 1 year ago • 3 comments

Self-service

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

Describe the bug

Not sure if this is a bug or expected behavior, but I think ideally, injectEnvironmentFiles variable(s) should be injected when loading yarn with PnP.

smcenlly avatar May 29 '24 23:05 smcenlly

We need a repro as it's unlikely PnP is the cause for whatever you're seeing.

arcanis avatar May 30 '24 05:05 arcanis

Here is a sample repo.

When we run:

yarn node test.js

We see:

ziggy.foo

Our application is being loaded in node, but we then require('./.pnp.cjs') in our application bootstrap. Yarn dependencies are then resolved correctly, etc. This is the same as running:

node loadedFromSomethingUsingPnP.js

In this case, we see:

undefined

We would expect that the yarn injectEnvironmentFiles would be loaded by the .pnp.cjs scripts.

smcenlly avatar May 30 '24 06:05 smcenlly

Hi! 👋

It seems like this issue as been marked as probably resolved, or missing important information blocking its progression. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it.

yarnbot avatar Jun 29 '24 07:06 yarnbot