Compatibility with yarn v2
See original GitHub issueWhen running in the context of Yarn v2 Pnp, this plugin fails with the error.
Example with react-grid-layout
:
[!] (plugin postcss) Error: EISDIR: illegal operation on a directory, read
../../../.yarn/$$virtual/react-grid-layout-virtual-663c3a9629/0/cache/react-grid-layout-npm-0.16.6-5842f88c2d-2.zip/node_modules/react-grid-layout/css/styles.css
The only workaround is to yarn unplug react-grid-layout
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9
Top Results From Across the Web
Migration | Yarn - Package Manager
A step-by-step and in-depth migration guide from Yarn 1 (Classic) to Yarn 2 (Berry).
Read more >It's 2021, and You Should Switch to Yarn 2 - Atomic Spin
1. Backwards Compatibility with node_modules ... Yarn 2 uses a new Plug'n'Play (PnP) architecture that is a huge departure from how npm projects ......
Read more >Compatibility with yarn 2 (or yarn 1 PnP mode) #458 - GitHub
Current Behavior. Yarn v2 got a stable release today, and it uses PnP (instead of node_modules) exclusively
Read more >What's the problem with Yarn 2? - Nicholas Martin
One of the biggest gripes engineers seem to have is that Yarn 2 is such a drastic change that it isn't even compatible...
Read more >Yarn 2 — the future of package managers for JavaScript? - Snyk
How to get started with Yarn 2? Yarn has adopted a per-repository — or per-project if you will — install strategy which means...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I explored a bit this repo and also
postcss-load-config
repo.The bug starts here:
https://github.com/egoist/rollup-plugin-postcss/blob/026504ef0480910e830873c30c5b133e2a130a64/src/postcss-loader.js#L23
Here, as there is no configPath, id is used to set the
configPath
variable. This variable is then passed as the path argument offindPostcssConfig
(frompostcss-load-config
). Its value is the path of the folder of the required file (e.g.: .yarn/$$virtual/react-grid-layout-virtual-663c3a9629/0/cache/react-grid-layout-npm-0.16.6-5842f88c2d-2.zip/node_modules/react-grid-layout/css/).This path is then passed to
cosmiconfig
as the search path.https://github.com/michael-ciniawsky/postcss-load-config/blob/bdaf431ef1142b5d0253aeb534aad8f42e46877e/src/index.js#L85-L95
This is where the error happens, I didn’t go deeper then here.
I am not an expert in yarn nor in cosmiconfig so I wouldn’t be able to tell you who is wrong here.
If you don’t need a postcss config, a workaround is:
If you still need one:
Funnily the responsibility for this bug is shared by both Yarn and cosmiconfig, as you can still reproduce it by creating a folder named “package.json”. But who does that? 😛
Anyway, I’ve fixed the Yarn part of the problem: https://github.com/yarnpkg/berry/pull/1204 🙂