Yarn taking 20 minutes do build new Sage installation

I’m trying to install a new Sage Theme and Yarn is taking 20 minutes to build at Yarn command. I’ve tested in two different environments, macOS 13.5 and Windows 11 and the same occur. I’ve changed the Yarn version and Node version with no success.

I’m used to build frontend using Sage on my local desktop and this is the first time that I see Yarn taking too long to build.

Here the build Completed in 25m 35s:

success: installed and set node@20.5.1 (with npm@9.8.0) as default
192:~ viviancruz$ cd /Users/viviancruz/Library/Mobile\ Documents/com\~apple\~CloudDocs/Clientes/Acessebank/Sitio/voz-acesse 
192:voz-acesse viviancruz$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @roots/bud-babel@npm:6.7.3 [4c754] doesn't provide webpack (p681a6), requested by babel-loader
➤ YN0002: │ @roots/bud-entrypoints@npm:6.7.3 [f2529] doesn't provide webpack (p0377a), requested by @roots/entrypoints-webpack-plugin
➤ YN0002: │ @roots/bud-postcss@npm:6.7.3 [4c754] doesn't provide webpack (p71895), requested by postcss-loader
➤ YN0002: │ @roots/bud-react@npm:6.7.3 [563c6] doesn't provide webpack (p0ecf6), requested by @pmmmwh/react-refresh-webpack-plugin
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 264ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @roots/bud@npm:6.7.3 [ed0cd] must be built because it never has been before or the last one failed
➤ YN0008: │ core-js-pure@npm:3.26.1 must be rebuilt because its dependency tree changed
➤ YN0000: └ Completed in 25m 35s
➤ YN0000: Done with warnings in 25m 36s

node@20.5.1 (with npm@9.8.0) as default
Yarn 3.6.2

Yarn remove and other commands are either too long which makes it impossible to work on my project like this.

I did research about any problem like this on Yarn but only at very old versions of Yarn.

I just opened this topic because I had tested it on 2 different environments and 2 internet connections. Today Im working at my home and everything is back to normal. I couldn’t say for sure if it was an unstable internet connection at the 2 locations. :pray:

2 Likes

I was about to open a new topic on this when I saw this thread. Has the problem been solved for you permanently? The reason I ask is that I haven’t had problems installing dependencies before, but now I get these dreaded 30 minute install sessions with bud you describe above. The trouble is that this occurs while using the internet connection where I work, where the connectivity cannot be improved.

I’m using yarn berry, with the nodeLinker set to node-modules in .yarnrc.yml on a Macbook Pro. When I try to install core-js-pure in an empty folder somewhere else yarn takes 3 seconds to perform the linking, 5 seconds running the entire command.

The process either hangs on core-js-pure or @roots/browserslist-config. I just upgraded bud and the install took 26 minutes:

➤ YN0000: └ Completed in 14s 920ms
➤ YN0000: ┌ Fetch step
➤ YN0019: │ @roots-wordpress-dependencies-webpack-plugin-npm-6.15.1-c42b8225bc-c8c6828193.zip appears to be unused - removing
➤ YN0019: │ @roots-wordpress-externals-webpack-plugin-npm-6.15.1-39474f44f2-4b25860972.zip appears to be unused - removing
➤ YN0019: │ @roots-wordpress-hmr-npm-6.15.1-32fe145cd8-2f74c6e72a.zip appears to be unused - removing
➤ YN0019: │ @roots-wordpress-theme-json-webpack-plugin-npm-6.15.1-3d22625fbb-84926617ad.zip appears to be unused - removing
➤ YN0019: │ @roots-wordpress-transforms-npm-6.15.1-c315161405-f6584e1d7a.zip appears to be unused - removing
➤ YN0000: └ Completed in 4s 945ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @roots/bud-framework@npm:6.15.2 must be built because it never has been before or the last one failed
➤ YN0007: │ @roots/browserslist-config@npm:6.15.2 must be built because it never has been before or the last one failed
➤ YN0008: │ core-js-pure@npm:3.26.1 must be rebuilt because its dependency tree changed
➤ YN0000: └ Completed in 26m 59s
➤ YN0000: Done with warnings in 27m 19s

Is there a way to debug this process or to get more logging info for the install process? My package.json looks as follows:

{
  "name": "sage",
  "private": true,
  "browserslist": [
    "extends @roots/browserslist-config"
  ],
  "engines": {
    "node": ">=16.0.0"
  },
  "type": "module",
  "scripts": {
    "dev": "bud dev",
    "build": "bud build",
    "translate": "yarn translate:pot && yarn translate:update",
    "translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"app,resources\"",
    "translate:update": "wp i18n update-po ./resources/lang/sage.pot ./resources/lang/*.po",
    "translate:compile": "yarn translate:mo && yarn translate:js",
    "translate:js": "wp i18n make-json ./resources/lang --pretty-print",
    "translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
  },
  "devDependencies": {
    "@roots/bud": "6.15.2",
    "@roots/bud-eslint": "6.15.2",
    "@roots/bud-prettier": "6.15.2",
    "@roots/bud-sass": "6.15.2",
    "@roots/bud-stylelint": "6.15.2",
    "@roots/eslint-config": "6.15.2",
    "@roots/sage": "6.15.2",
    "svg-spritemap-webpack-plugin": "^4.5.0"
  },
  "packageManager": "yarn@3.6.0",
  "dependencies": { }
}

I’ve got the same problemen with a very stable and fast internet connection. It’s stuck on the following install:

➤ YN0000: ┌ Resolution step
➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ stable@npm:0.1.8 is deprecated: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
➤ YN0000: └ Completed in 17s 295ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ lru-cache@npm:10.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minipass-fetch@npm:3.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ minipass@npm:7.0.3 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ signal-exit@npm:4.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ ssri@npm:10.0.5 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 0s 465ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @roots/bud-framework@npm:6.12.2 must be built because it never has been before or the last one failed
➤ YN0007: │ @roots/browserslist-config@npm:6.12.2 [1d2a0] must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.26.1 must be built because it never has been before or the last one failed

I’m on MacOs 13.3.1

I opened an issue at bud’s tracker a while back related to this problem, but closed it because it seemed a problem with my configuration. Considering I’m not the only one with this problem, I’m thinking of maybe reopening it.

This is probably an issue with the post install command to update the browserslist. It’s triggered in node_modules/@roots/browserslist-config/scripts/postinstall.mjs.

If I execute the command in that script file (npx browserslist --update-db) yarn goes on to update caniuse-lite using (yarn up -R caniuse-lite) which takes forever. Is it the same for you?

Yeah, looks like that’s the problem.

We are experiencing the exact same problem. Is there a workaround?

Also running into this issue, I’m following the steps from others but it gets hung up on `browserslist-config like everyone else and has crashed my M1 Macbook Air multiple times

I also have this problem, on MacOS.

Anyone found a workaround or a fix for this ?

I’m stuck, I tried removing caniuse references manually, updating packages independently, trying update with npm instead of yarn, emptying caches, installing caniuse independently, etc.

Every time install fails or assets don’t build… And no error messages.

I’ve reopened the issue over at the bud issue tracker. Might be good to post any relevant details of your troubles as well over there.

No workaround as of yet. The build eventually resolves in my case but it sometimes takes over 30 to 40 minutes. I’m not on a M1 MacBook by the way, so that doesn’t seem to factor into things.

guess this is the same issue…

➤ YN0000: └ Completed in 0s 449ms
➤ YN0000: ┌ Link step
➤ YN0000: ⠇ --------------------------------------------------------------------
➤ YN0007: │ @roots/bud-framework@npm:6.16.1 must be built because it never has been before or the last one failed
➤ YN0008: │ @roots/bud-framework@npm:6.12.2 must be rebuilt because its dependency tree changed
➤ YN0008: │ @roots/browserslist-config@npm:6.12.2 [1d2a0] must be rebuilt because its dependency tree changed
➤ YN0000: └ Completed in 96m 56s
➤ YN0000: · Done in 96m 57s

Thanks. Eventually it worked for me after 43minutes… I am using an Intel MacBook so yeah, I don’t think the problem is linked with the processor.

For anyone else that runs into this, it seems to be an issue of both Yarn, Node, and possibly the Sage version.

I was experiencing the same issue everyone else reported using:
Yarn: 3.x
Node: 18.7.x, 20.x
Sage: 6.9.1

After playing with a few different versions:
Yarn: yarn set version canary
Node: 19.6.0
Sage: 16.7.0

Was able to install Sage in about 20s afterwards and yarn build in about 25s.

3 Likes

@LucasDemea confirmed on https://github.com/roots/bud/issues/2370 that the current Bud nightlies that include ✨ improve(patch): deterministic browserslist configs by kellymears · Pull Request #2467 · roots/bud · GitHub fixed this issue for him

We’ve been unable to reproduce this still, so if you’re running into this issue then you could try switching to a nightly release to get around the problem

Im experiencing this 20-30 min delay on Radicle 1.2.1 - trying to set it up on Windows WSL1 —

➤ YN0000: · Yarn 4.0.0-rc.53
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @playwright/test@npm:1.38.0, @roots/bud-eslint@npm:6.16.1, @roots/bud-imagemin@npm:6.16.1, @roots/bud-preset-wordpress@npm:6.16.1, @roots/bud-prettier@npm:6.16.1, @roots/bud-stylelint@npm:6.16.1, @roots/bud-swc@npm:6.16.1, and 1383 more.
➤ YN0000: └ Completed in 1s 671ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ radicle@workspace:. doesn’t provide tailwindcss (p1a13f), requested by @tailwindcss/forms.
➤ YN0086: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements for details, where is the six-letter p-prefixed code.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 630ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @roots/bud-framework@npm:6.16.1 must be built because it never has been before or the last one failed
➤ YN0007: │ sharp@npm:0.32.5 must be built because it never has been before or the last one failed
➤ YN0007: │ @swc/core@npm:1.3.78 [4c1e5] must be built because it never has been before or the last one failed
➤ YN0007: │ @roots/browserslist-config@npm:6.16.1 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.30.2 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 29m 24s
➤ YN0000: · Done with warnings in 29m 27s

is there a way to get the nightly patch for it as well, or an easy way to modify to get the workaround .

My 2cts here: WSL 1 has superior cross-file system performance compared to WSL 2, that’s true. But having the source code on WSL 2 Linux filesystem (as in ~/src/) improved the performance much, much further. Before you update to WSL 1 - just put the source code onto the Linux filesystem (~/src/) and build from there, the performance gains may already be sufficient.

Update all of your bud.js dependencies (from 6.16.1 based to your post) to a nightly version

thanks Ill try that now,

Im trying to use wsl2 , —> and trellis because Im a glutton for punishment

  • I gave up after 60-100 hours of trouble shooting the first time - im coming back for a second round

l…I was able to get bedrock/sage/wsl1/windows to work with local by flywheel → up to a point but the ssh hurdle and wp cli being locked into the local by flywheel ssh environment (wasn’t talking with acorn) were a dealbreaker - and I didn’t have it in me to be the one to solve it

so im back for another round hoping radicle will smooth the way
im blown away by the possibility of bringing laravel into wordpress the way your team has
great work!

Adding in what I experienced as well

yarn: 4.0.1
node: 20.9.0
sage: 10.7.0

After running composer create-project roots/sage, I ran yarn && yarn build and got the below output until my Mac M1 crashed. I’ve repeated this 3x.

➤ YN0000: · Yarn 4.0.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 249ms
➤ YN0000: ┌ Link step
➤ YN0008: │ @roots/bud-framework@npm:6.16.1 must be rebuilt because its dependency tree changed
➤ YN0007: │ @roots/browserslist-config@npm:6.16.1 must be built because it never has been before or the last one failed

As @ben directed, I updated bud.js using npm i @roots/bud. When I ran yarn && yarn build, it completed in a few seconds.