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

yarn run gatsby build stalles in run queries in workers #35192

Closed
2 tasks done
hellow554 opened this issue Mar 22, 2022 · 5 comments · Fixed by #35194
Closed
2 tasks done

yarn run gatsby build stalles in run queries in workers #35192

hellow554 opened this issue Mar 22, 2022 · 5 comments · Fixed by #35194
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) type: bug An issue or pull request relating to a bug in Gatsby

Comments

@hellow554
Copy link

hellow554 commented Mar 22, 2022

Preliminary Checks

Description

When unning yarn run gatsby build the progress stalls, here's a log:

success compile gatsby files - 0.543s
success load gatsby config - 0.018s
success load plugins - 0.154s
success onPreInit - 0.001s
success delete worker cache from previous builds - 0.002s
success initialize cache - 0.091s
success copy gatsby files - 0.098s
success Compiling Gatsby Functions - 0.404s
success onPreBootstrap - 0.421s
success createSchemaCustomization - 0.002s
success Checking for changed pages - 0.001s
success source and transform nodes - 0.037s
info Writing GraphQL type definitions to /tmp/tmp.XznRs8rQkV/.cache/schema.gql
success building schema - 0.340s
success createPages - 0.001s
success createPagesStatefully - 0.079s
info Total nodes: 20, SitePage nodes: 1 (use --verbose for breakdown)
success Checking for changed pages - 0.001s
success Cleaning up stale page-data - 0.003s
success onPreExtractQueries - 0.001s
success extract queries from components - 0.130s
success write out redirect data - 0.005s
success onPostBootstrap - 0.002s
info bootstrap finished - 5.077s
success write out requires - 0.009s
success Building production JavaScript and CSS bundles - 0.818s
success Building HTML renderer - 0.372s
success Execute page configs - 0.036s
success Caching Webpack compilations - 0.003s
[                            ]   0.001 s 0/1 0% run queries in workers

If you remove the (empty) gatsby-config.js file it "compiles" just fine.
npm run build also just works fine.

Reproduction Link

https://github.com/hellow554/gatsby-yarn

Steps to Reproduce

  1. yarn install
  2. yarn run gatsby build

Expected Result

The build is succeful

Actual Result

The build stalls

Environment

System:
    OS: Linux 5.10 Ubuntu 21.10 21.10 (Impish Indri)
    CPU: (8) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Shell: 3.1.2 - /usr/local/bin/fish
  Binaries:
    Node: 14.19.1 - /tmp/xfs-13e4cf48/node
    Yarn: 3.2.0 - /tmp/xfs-13e4cf48/yarn
    npm: 6.14.16 - /usr/bin/npm
  Languages:
    Python: 3.9.7 - /usr/bin/python

Config Flags

module.exports = {};
@hellow554 hellow554 added the type: bug An issue or pull request relating to a bug in Gatsby label Mar 22, 2022
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 22, 2022
@pieh
Copy link
Contributor

pieh commented Mar 22, 2022

Hey @hellow554, we are looking into yarn@2+ issues and work-in-progress #35194 might also solve this issue.

@pieh
Copy link
Contributor

pieh commented Mar 22, 2022

Just out of curiosity - are you using PnP mode of yarn@3? or the node_modules / node_linker mode? (not sure if it's relevant, so far I was debugging issue with yarn@3 PnP, but the issue might very well be just yarn@3 regardless of mode)

@pieh pieh added topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 22, 2022
@hellow554
Copy link
Author

Just out of curiosity - are you using PnP mode of yarn@3? or the node_modules / node_linker mode?

I'm using the default and IIRC it's using the pnp mode.
Not an expert though.

@pieh
Copy link
Contributor

pieh commented Mar 22, 2022

Just released @next version ([email protected]) and I get it to build now:

➜  gatsby-yarn git:(main) ✗ yarn why gatsby
└─ tmp.XznRs8rQkV@workspace:.
   └─ gatsby@npm:4.11.0-next.4 [4ed86] (via npm:4.11.0-next.4 [4ed86])
➜  gatsby-yarn git:(main) ✗ yarn gatsby clean && yarn run gatsby build
info Deleting .cache, public, /Users/misiek/test/gatsby-yarn/node_modules/.cache/babel-loader,
/Users/misiek/test/gatsby-yarn/node_modules/.cache/terser-webpack-plugin
info Successfully deleted directories

success compile gatsby files - 0.642s
success load gatsby config - 0.025s
success load plugins - 0.186s
success onPreInit - 0.001s
success initialize cache - 0.144s
success copy gatsby files - 0.155s
success Compiling Gatsby Functions - 0.403s
success onPreBootstrap - 0.425s
success createSchemaCustomization - 0.002s
success Checking for changed pages - 0.001s
success source and transform nodes - 0.050s
info Writing GraphQL type definitions to /Users/misiek/test/gatsby-yarn/.cache/schema.gql
success building schema - 0.497s
success createPages - 0.001s
success createPagesStatefully - 0.127s
info Total nodes: 20, SitePage nodes: 1 (use --verbose for breakdown)
success Checking for changed pages - 0.008s
success onPreExtractQueries - 0.001s
success extract queries from components - 0.117s
success write out redirect data - 0.057s
success onPostBootstrap - 0.001s
info bootstrap finished - 6.609s
success write out requires - 0.014s
success Building production JavaScript and CSS bundles - 7.670s
success Building HTML renderer - 4.274s
success Execute page configs - 0.021s
success Caching Webpack compilations - 0.001s
success run queries in workers - 0.039s - 1/1 25.52/s
success Merge worker state - 0.024s
success Rewriting compilation hashes - 0.021s
success Writing page-data.json files to public directory - 0.014s - 1/1 70.86/s
success Building static HTML for pages - 5.490s - 1/1 0.18/s
success onPostBuild - 0.001s
info Done building in 24.699195745 sec


Pages

└ src/pages/index.tsx
  └   /

  ╭────────────────────────────────────────────────────────────────╮
  │                                                                │
  │   (SSG) Generated at build time                                │
  │ D (DSG) Deferred static generation - page generated at runtime │
  │ ∞ (SSR) Server-side renders at runtime (uses getServerData)    │
  │ λ (Function) Gatsby function                                   │
  │                                                                │
  ╰────────────────────────────────────────────────────────────────╯

For now just in @next, but will be cherry-picking and releasing fix to latest line as well later today

@hellow554
Copy link
Author

Can confirm it works. Thanks for the (very) fast fix! Amazing ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants