Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby): fix PNP resolving from the .cache folder #31732

Merged
merged 2 commits into from
Jun 3, 2021
Merged

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Jun 2, 2021

Description

Add an extra resolver to route dependencies used in the .cache folder from "gatsby" package to actually route properly through PNP.

Related Issues

Fixes #30114 #19316
[ch32208]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 2, 2021
@wardpeet wardpeet added type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 2, 2021
@wardpeet wardpeet marked this pull request as ready for review June 2, 2021 18:11
Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pieh pieh merged commit d10e8ce into master Jun 3, 2021
@pieh pieh deleted the feat/fix-pnp branch June 3, 2021 08:04
Comment on lines +21 to +23
if (!(process.versions as ProcessWithPNP).pnp) {
return
}
Copy link
Contributor

@merceyz merceyz Jun 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if I'm missing some context here but shouldn't it always do this regardless if PnP is enabled or not? Otherwise it's relying on hoisting quite a lot - https://yarnpkg.com/advanced/rulebook#packages-should-only-ever-require-what-they-formally-list-in-their-dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should but it could be a subtle breaking change for some so I made sure to only fix it for pnp in v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gatsby v3 - SSR bundle failed - build issues, using Yarn v2
3 participants