Yarn 2 issues #20949
Replies: 37 comments 5 replies
-
👋 I'll contribute by adding a repro repo. Feel free to edit my comment to keep it up to date
|
Beta Was this translation helpful? Give feedback.
-
Hey there 👋 I'm trying to upgrade https://github.com/GaiAma/Coding4GaiAma/ to Yarn 2 with PnP and local cache, unfortunately even tho ERROR # bold and red
There was a problem loading the local build command. Gatsby may not be installed in your site's "node_modules" directory. Perhaps you need to run "npm install"? You might need to delete your "package-lock.json" as well.
yarn why gatsby Node 12.14.1 14:38:29
├─ @gaiama/coding4.gaiama.org@workspace:sites/coding4.gaiama.org
│ └─ gatsby@npm:2.19.8 [ecd19] (via npm:^2.19.8 [ecd19]) and yarn why gatsby-cli Node 12.14.1 19:21:37
├─ @gaiama/coding4.gaiama.org@workspace:sites/coding4.gaiama.org
│ └─ gatsby-cli@npm:2.8.28 (via npm:^2.8.28) tho indicating, I believe, that gatsby & gatsby-cli indeed have been installed as dependency of the site workspace I have a .yarnrc.yml content (press to unveil)packageExtensions:
'@babel/parser@*':
dependencies:
'@babel/types': '*'
'@nodelib/fs.scandir@*':
dependencies:
'@types/node': '*'
'@nodelib/fs.stat@*':
dependencies:
'@types/node': '*'
'@nodelib/fs.walk@*':
dependencies:
'@types/node': '*'
'@octokit/rest@*':
dependencies:
'@octokit/core': '*'
'@theme-ui/theme-provider@*':
dependencies:
'@theme-ui/css': '*'
react: '*'
fast-glob@*:
dependencies:
'@types/node': '*'
gatsby-cli@*:
dependencies:
'@types/react': '*'
gatsby-link@*:
dependencies:
'@types/reach__router': '*'
react: '*'
gatsby-plugin-netlify@*:
dependencies:
webpack: '*'
gatsby-source-graphql@*:
dependencies:
graphql: '*'
gatsby-transformer-leasot@*:
dependencies:
gatsby: '*'
gatsby@*:
dependencies:
'@types/reach__router': '*'
'@types/react': '*'
react: '*'
theme-ui@*:
dependencies:
react: '*'
unist-util-is@*:
dependencies:
'@types/unist': '*'
'gatsby-plugin-theme-ui@*':
dependencies:
'theme-ui': '^0.3.1'
'@theme-ui/style-guide@*':
dependencies:
'theme-ui': '^0.3.1'
sharp@*:
devDependencies:
'node-gyp': '*'
nan@*:
devDependencies:
'node-gyp': '*'
fsevents@*:
devDependencies:
'node-gyp': '*'
evp_bytestokey@*:
devDependencies:
'node-gyp': '*' to make all those dependency resolution errors go away^^ Uh yeah Just deleted by the way running ERROR # bold and red
Usage: gatsby <command> [options]
Commands:
gatsby develop Start [..]
[..] whereas "gatsby-cli": "^2.8.28" (in devDependencies) Environment (interestingly `yarn gatsby info` works ^^) System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.14.1 - /var/folders/_j/h1t1t4qj0vg7l33695q_tck80000gn/T/tmp-757732S6N7tBDAHb/node
Yarn: 2.0.0-rc.27 - /var/folders/_j/h1t1t4qj0vg7l33695q_tck80000gn/T/tmp-757732S6N7tBDAHb/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
Languages:
Python: 2.7.16 - /usr/local/bin/python
Browsers:
Chrome: 79.0.3945.130
Firefox: 71.0
Safari: 13.0.5
npmGlobalPackages:
gatsby-cli: 2.8.27 Any idea before I try to get a repro running or push the branch? Update: Update2: definitely not minimal but I pushed the branch GaiAma/Coding4GaiAma/tree/feat/yarn2 |
Beta Was this translation helpful? Give feedback.
-
@esphen I believe I have found the issue, |
Beta Was this translation helpful? Give feedback.
-
Ok, just "abandoned" the yarn2 branch for now 😅 |
Beta Was this translation helpful? Give feedback.
-
I had these warnings when installing fresh with yarn 2, which ultimately detonated when building; Hope that helps? |
Beta Was this translation helpful? Give feedback.
-
@herecydev ahh yeah seems like typescript and sass plugin have some issues? I can look into them. Thx! |
Beta Was this translation helpful? Give feedback.
-
I'm running
|
Beta Was this translation helpful? Give feedback.
-
Issue with
|
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue as @asilgag and @herecydev A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't
Required package: @babel/core (via "@babel/core")
Required by: @babel/plugin-transform-react-jsx@virtual:ce221797d3c2a65455a47f71304c968616b4e01d384928501d1d99acb19845e36e2aed392dc57b5b3d2cd4f6be1eb6181c99965b41609770412b29aa0afaa5aa#npm:7.8.0 (via /home/ajmoon/code/moonmeister/moonmeister.net/.yarn/$$virtual/@babel-plugin-transform-react-jsx-virtual-756e2f4bce/0/cache/@babel-plugin-transform-react-jsx-npm-7.8.0-b6c3d38c84-2.zip/node_modules/@babel/plugin-transform-react-jsx/lib/)
Update...on prod builds I also get @keirwilliams issue as well |
Beta Was this translation helpful? Give feedback.
-
Repro https://github.com/ozimos/gatsby-yarn2-bug-repro
ERROR #98123 WEBPACK
Generating SSR bundle failed
Can't resolve './.cache/typography' in '/Users/
File: .yarn/$$virtual/gatsby-plugin-typography-virtual-50a295679f/0/cache/gatsby-plugin-typography-npm-2.3.22-69802deac4-2.zip/node_modules/gatsby-plugin-typography/gatsby-ssr.js
provides this additional error message "gatsby-plugin-typography" threw an error while running the onPreBootstrap lifecycle:
EROFS: read-only filesystem, mkdir '/node_modules/gatsby-plugin-typography/.cache'
26 |
27 | if (!fs.existsSync(dir)) {
> 28 | fs.mkdirSync(dir);
| ^
29 | }
30 |
31 | fs.writeFileSync(dir + "/typography.js", module);
File: .yarn/$$virtual/gatsby-plugin-typography-virtual-50a295679f/0/cache/gatsby-plugin-typography-npm-2.3.22-69802deac4-2.zip/node_modules/gatsby-plugin-typography/gatsby-node.js:28:8 |
Beta Was this translation helpful? Give feedback.
-
@asilgag @moonmeister can you guys share a simplified example repo? I've tracked down a couple of those issues. I had the same problem, and it was caused by @ozimos you can workaround that by running |
Beta Was this translation helpful? Give feedback.
-
@Js-Brecht I am using emotion, so that's probably my issue. But if I have time I'll through together an example |
Beta Was this translation helpful? Give feedback.
-
#21848 has been filed to fix that plugin. |
Beta Was this translation helpful? Give feedback.
-
After updates to plugins from recent pull request emotion is no-longer causing issues. My most recent error is:
Here is a reproduction that shows it is related to |
Beta Was this translation helpful? Give feedback.
-
@moonmeister that ones a bit more tricky. The package Those two packages are used in What worked for me was using I'll check back when I'm happy with it. |
Beta Was this translation helpful? Give feedback.
-
A few issues:
(This seems non-fatal.)
This is fatal, though may have something to do with Material-UI (which we are using) rather than Gatsby. (Fixed in yarnpkg/berry#1424.) |
Beta Was this translation helpful? Give feedback.
-
Here I'm able to build Gatsby using Yarn 2, but it takes twice as long as Yarn 1: Yarn 1 -> 92 secs Yarn 1
Yarn 2
Any clue about this performance drop? |
Beta Was this translation helpful? Give feedback.
-
I am getting this:
|
Beta Was this translation helpful? Give feedback.
-
@barbalex Correction: Not transpiling... Should be able to fix it by moving gatsby/packages/gatsby/package.json Lines 156 to 159 in ff4ce02 |
Beta Was this translation helpful? Give feedback.
-
New case:
|
Beta Was this translation helpful? Give feedback.
-
More cases (not all gatsby):
|
Beta Was this translation helpful? Give feedback.
-
@barbalex Gatsby is unable to resolve the plugin defined here, because it doesn't keep gatsby/packages/gatsby-plugin-styled-components/src/gatsby-node.js Lines 10 to 18 in ff4ce02 That would need to be defined with an absolute path, but Gatsby uses that gatsby/packages/gatsby/src/redux/reducers/babelrc.ts Lines 51 to 69 in ff4ce02 Something would likely need to be done to preserve that behavior, but still allow for a fully resolved path. |
Beta Was this translation helpful? Give feedback.
-
@Js-Brecht seems like you have your work set... |
Beta Was this translation helpful? Give feedback.
-
Ahaha... yes, I would love to fix these issues, but unfortunately, I don’t have the time. It would probably be a few weeks before I’d be able to squeeze them in. |
Beta Was this translation helpful? Give feedback.
-
Yarn 2 doesn't have
Then, we can call:
|
Beta Was this translation helpful? Give feedback.
-
Any chances we can get some repros for these issues? A fresh install of gatsby doesn't give me any issues but those aren't real examples... |
Beta Was this translation helpful? Give feedback.
-
I installed gatsby-cli as dev dependency.
And then i solve this problem to add this on
I think |
Beta Was this translation helpful? Give feedback.
-
I tried to setup a new gatsby site today using yarn 2 and when starting the project I get the following error:
edit seems I can "fix" it by disabling eslint by adding a |
Beta Was this translation helpful? Give feedback.
-
Building Gatsby site from a starter with a custom theme, it builds fine with yarn 1
|
Beta Was this translation helpful? Give feedback.
-
Also, getting ...
Only things I can think of are that we're using gatsby-config.js // https://support.gatsbyjs.com/hc/en-us/articles/1500000294121-Using-ES6-Module-Syntax-in-Gatsby-API-Files-on-Gatsby-Cloud
// eslint-disable-next-line
require = require('esm')(module)
module.exports = require('./gatsby-config.esm.js')
|
Beta Was this translation helpful? Give feedback.
-
This is an umbrella issue for anything Yarn 2-related. If you test your sites, themes and plugins with Yarn 2 and there are issues that are not present in Yarn 1.21+ then reply with a comment below. Ideally include a link to a minimal reproduction, or at the very least a copy or gist link to your package.json and yarn.lock.
Yarn 2 tests its builds against Gatsby, so we are confident that the default starter builds correctly. However we are expecting issues to arrive, particularly with PnP, themes and component shadowing. You probably don't need to open a new issue for anything that can only be reproduced with Yarn 2, so comment here instead.
Beta Was this translation helpful? Give feedback.
All reactions