fix: show yarn pnp errors as-is instead of NotFound error#939
Conversation
How to use the Graphite Merge QueueAdd the label merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #939 +/- ##
=======================================
Coverage 94.46% 94.46%
=======================================
Files 18 18
Lines 3325 3325
=======================================
Hits 3141 3141
Misses 184 184 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #939 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
Yarn pnp errors were output as NotFound and was a bit confusing.
Before:
```
{
error: "Cannot find module 'use-sync-external-store/shim/with-selector.js'"
}
```
After:
```
{
error: "zustand tried to access use-sync-external-store, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.\n" +
'\n' +
'Required package: use-sync-external-store (via "use-sync-external-store/shim/with-selector.js")\n' +
'Required by: zustand@virtual:1c9ffcdd3c294d9f00a4700610b6eee225ba7496e9cf71f4e2c84e6a78adfb6d89ded76acac79698b89ce4168fbd26a40683c1459c3d813f8bbe6a6de1deb690#npm:5.0.9 (via /home/green/workspace/temp/oxc-resolver-yarn-pnp-bug/.yarn/__virtual__/zustand-virtual-88b9bb390c/4/.yarn/berry/cache/zustand-npm-5.0.9-1d6cab4a48-10c0.zip/node_modules/zustand/esm/)'
}
```
I got the message above by https://github.com/sapphi-red-repros/yarn-pnp-rust-error-message. It seems the error message is wrong as `require.resolve` shows
```
Error: zustand tried to access use-sync-external-store (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
Required package: use-sync-external-store (via "use-sync-external-store/shim/with-selector.js")
Required by: zustand@virtual:1c9ffcdd3c294d9f00a4700610b6eee225ba7496e9cf71f4e2c84e6a78adfb6d89ded76acac79698b89ce4168fbd26a40683c1459c3d813f8bbe6a6de1deb690#npm:5.0.9 (via /home/green/workspace/temp/oxc-resolver-yarn-pnp-bug/.yarn/__virtual__/zustand-virtual-88b9bb390c/4/.yarn/berry/cache/zustand-npm-5.0.9-1d6cab4a48-10c0.zip/node_modules/zustand/esm/)
Ancestor breaking the chain: oxc-resolver-yarn-pnp-bug@workspace:.
```
But I think that's a separate problem.
635352d to
1a6ca16
Compare

Yarn pnp errors were output as NotFound and was a bit confusing.
Before:
After:
I got the message above by https://github.com/sapphi-red-repros/yarn-pnp-rust-error-message. It seems the error message is wrong as
require.resolveshowsBut I think that's a separate problem.