question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gatsby build occasionally time out after "Caching JavaScript and CSS webpack compilation"

See original GitHub issue

Preliminary Checks

Description

About a month ago, builds of my Gatsby site started failing in GitHub Actions.

For context, this Gatsby site is a minimal example using my gatsby-source-s3 plugin, that I use for testing the plugin end-to-end.

Here’s from an example of a failed build:

# ℹ️ omitted earlier logs, check out the link above to view the entire output
success run page queries - 13.660s - 1/1 0.07/s # 👈 this is after all nodes were sourced from S3, so I don't think the problem is with my plugin
success write out requires - 0.011s
success Building production JavaScript and CSS bundles - 9.577s
success Rewriting compilation hashes - 0.005s
success Writing page-data.json files to public directory - 0.017s - 1/1 57.50/s
success Caching JavaScript and CSS webpack compilation - 13.059s # 👈 this is where is hangs
Error: Timed out waiting for: http://localhost:9000 # 👈 this is the timeout from cypress. I've also increased it to see if it just took too long, but that was not the issue

At first, all builds were failing, and in the last week it seems that some of them are passing again while others are still failing.

I’m not sure what’s happening here, as there are no helpful logs in the build output. A local gatsby develop works completely fine. The occasional passing build seem to rule out issues in my project or in other dependencies. I also asked on discord but it didn’t seem like anyone was having the same issue.

Any thoughts on:

  • what the issue is here
  • how I could debug this—I haven’t found anything on the docs about this

Thank you!

A note about the reproduction link 👇 I am aware that the issue template says “Do not link to your actual project”, but in my case this example site is exactly a minimal example, since the only thing is does is pulling images from S3. I added the GH Action output there, here’s the link to the actual source although I doubt that it will be helpful.

Reproduction Link

https://github.com/robinmetral/gatsby-source-s3/runs/3912139392?check_suite_focus=true

Steps to Reproduce

  1. Visit the link above to see the failing build output. I cannot reliably reproduce this locally, as mentioned in the summary.

Expected Result

gatsby build should not time out

Actual Result

gatsby build is flaky and unreliable, and regularly hangs in CI envs

Environment

My local environment is not the issue here, this is failing on a clean GH Actions machine with:

  • Ubuntu 20.04 LTS
  • Latest Node 14
  • Gatsby 3

Config Flags

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:34 (17 by maintainers)

github_iconTop GitHub Comments

8reactions
robmarshallcommented, Oct 18, 2021

I am also having this issue. I feel (although not sure) that these are caused by sharp plugin. gatsby-transformer-sharp & gatsby-plugin-sharp maybe.

edit: Reverting both of the above plugins to 3.12.0 meant the builds passed.

5reactions
sirichardscommented, Oct 22, 2021

Upgrading to Gatsby v4 with related packages now causes my build to stop at “success run queries in workers - 7.453s - 65/65 8.72/s”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Common Errors - Gatsby
Problems with the cache · Errors with common plugin configurations. Installing plugins for styling results in Generating SSR bundle failed · Errors in...
Read more >
Gatsby v4 works locally, but timed out on Netlify - Support
Gatsby build occasionally time out after "Caching JavaScript and CSS webpack compilation"
Read more >
Gatsby Cloud Build Failing with "Out of Memory" Error
I'm running into an "Out of Memory" issue during my Gatsby Cloud builds for my site. It will stop running on the "Rewriting...
Read more >
Just-in-Time Mode - Tailwind CSS
Lightning fast build times. Tailwind can take 3–8s to initially compile using our CLI, and upwards of 30–45s in webpack projects because webpack...
Read more >
An Honest Review of Gatsby - Hacker News
After all, its a database query language trying to create a giant cache of its results. For example, we have what roughly amounts...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found