-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Issue: warning Query takes too long + Build breaks on netlify #30256
Comments
I have the same error. The other problem is that
|
Same here. I updated to Gatsby v3 and my build went from 3 minutes to 30 minutes with a timeout on Netlify. I see many of these messages.
The website is open source. In particular, the build logs are complaining about the page query in my const query = graphql`
query($slug: String!) {
markdownRemark(frontmatter: {slug: {eq: $slug}}) {
html
frontmatter {
slug
title
date(formatString: "MMMM D, YYYY")
tags
image {
publicURL
childImageSharp {
gatsbyImageData(
width: 750
placeholder: BLURRED
formats: [AUTO, WEBP, AVIF]
quality: 100
)
}
}
}
}
}
` |
i have the same problem. |
This was assigned topic: scaling builds, so just for information: This is a rather small site. Like 15 pages total, and the queries in question query just some markdown and one image max. |
We've heard reports that |
I will try it tomorrow, thanks for the suggestion |
@vladar That's definitely the case, another point could be the DOMINANT_COLOR option. When it comes to images, could you also disable warnings on FULL_WIDTH images? It seems kind of redundant ;) |
@vladar I took your advice and simplified my childImageSharp {
gatsbyImageData(
width: 750
placeholder: BLURRED
formats: [AUTO, WEBP, AVIF]
quality: 100
)
} Down to this. childImageSharp {
gatsbyImageData(width: 750)
} But, I saw no changes or improvements in the build time. All of the
|
I haven't done the test without AVIF yet. As I have both Gatsby cloud build and Netlify build on the same site, I can report the differences:
Note that on Gatsby Cloud the Query takes too long warning does not happen |
@lomby92 Image processing in Gatsby Cloud is heavily optimized. So this could explain the difference if the source of the issue is @bradgarropy This happens locally for you too? If I run it locally - will I see the same issue? Or does it only happen on Netlify? |
We may be seeing this sharp issue in play here: lovell/sharp#2597 (not 100% sure yet) There is a work in progress to improve it though. |
@vladar thanks for the info about the Gatsby Cloud optimization. After a local test I was able to reproduce the warning disabling the AVIF format. Without AVIF
With AVIF
Transforming images into AVIF format uses all my CPU 6c/12t at 100%. Also, in this case I can see the warnings as expected. ConclusionsAs you can see, the AVIF setting lead to a longer build, it's confirmed |
I can confirm that the build works without AVIF. Though I'm still getting the Query takes to long warning. I'm now also getting an seemingly unrelated error, which also doesn't appear locally. (The build passes though).
|
@vladar This only happens on Netlify, locally things run just fine! |
I'm going to add a note to the docs warning about the build time performance implications of AVIF support. It's the reason we don't enable it by default. I think the issue here is that Netlify containers don't appear to have enough memory to handle AVIF builds on your site, whereas Gatbsy Cloud is specifically optimised to handle it. |
That sounds great @ascorbic! |
Just hopping in to confirm that I am seeing this error as well, build is still completing in my case but I am testing it on just my personal website. As mentioned above I was also seeing the deprecation warnings about Webpack |
@ehowey can you share a reproduction project for |
@vladar It seems to have gone away now - at least in the most recent builds on Gatsby v3.2. I'll pop back in here if I see it again. Since that time I have done some optimizations to my GraphQL queries for the images so I may have even solved it myself. One thing I had happening early in my transition to Gatsby v3 and gatsby-plugin-image was queries that were just |
@ehowey Were the source images very large? That's the only scenario where I could see having it without options could make it slow, as it would default to the full size with constrained layout. |
@vladar After updating to |
@ascorbic could be - sometimes I take images straight from Unsplash and don't bother downsizing them because Gatsby has usually handled that for me. |
Just wanted to comment here that I'm experiencing this with local builds on both a 2017 macbook pro (4 core / 16gb ram) and a remote Ubuntu development server with 4 cores / 8gb ram. No issues with Gatsby Cloud, and we don't build on Netlify anymore (but we do deploy there for Netlify functions). We have image fragments with When I When I MBP:
Ubuntu:
MBP Info:
Ubuntu VM Info
|
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
I'm getting this on all my recent builds on Netlify, its take my build times from ~5 minutes to 30+ minutes. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Description
I'm getting the Warning
Query takes too long
on very small queries, for example:This is not a problem for building my site locally but is on netlify which enforces a RAM limit (NPM error code 137).
I have no idea why such a query would be so big. At first I thought it might be related to the new gatsby-plugin-image but it also appears on some sites with very small queries, like the above.
Steps to reproduce
Expected result
Should be built without Error and query takes too long warning
Actual result
Getting npm ERR! code 137 (out of memory)
Environment
The text was updated successfully, but these errors were encountered: