-
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
Gatsby@2.11.0 Build failure (JavaScript heap out of memory) #15190
Comments
Okay, so this is definitely a node issue. It seems that the extra transpiling being done is just now making node hit it's default limit in my case. I ran this seems strange that node doesn't just request more memory if it's available, also I'm a little concerned how this might affect folks build servers. |
Yeah, affects Netlify too. I was able to get Netlify to build correctly by adding an environment variable: [build.environment]
NODE_OPTIONS = "--max_old_space_size=4096" |
This seems like it might negatively affect a lot of people. Any way we can make this more memory efficient? |
@moonmeister OMG thank you so much I just updated my package.json file and suddenly this issue crept up. And yes increasing the size solved the issue. |
@vickylance figured I wouldn't be the only one. Glad you figured it out. |
However netlify does not seem to build even after increasing the node size. Its not throwing an error but its just staying building forever. EDIT: it got published. But it took a lot of time to build |
I've got the same issue I think, @vickylance and @moonmeister - I can test the environment variable fix if someone can guide me how? :) Not done them before - is it just as here in Netlify? |
Not sure you need the quotes but that looks correct. |
OK - didn't work with the quotes initially. I'll try without. EDIT: Works without quotes in Netlify |
Yeah, build times have definitely increased. I'm not sure what value this adds, I'm sure it does but it seems to have some significant downsides too. |
@moonmeister Yes my build time was less than a min and now its more than 6 mins |
Same here; environment variable fixed it, but it took an age to deploy. Not sure about you guys but I also got a lot of lines of...
Not seen that before myself. EDIT: In Netlify |
@gatsbyjs/core Can we get some input here? This isn't strictly a Gatsby issue but definitely caused by a decision the Gatsby project made. IS there a way to disable this for folks that don't want it, or maybe a way to optimize the process to increase performance/build times (or at least not break node)? |
It only took 20-40s longer on gatsbyjs.org when transpiling node_modules so it's weird that it's so heavy for your sites. I'll have a look at your repro! @moonmeister |
@wardpeet Thanks! My site is only page (aside from the cms), so it wasn't much to start with...but it probably still doubled. If anyone else has repositories they can share that may be helpful. |
Same problem on my side. This has been driving me bananas. I'm glad to find out it's an issue on Gatsby's last version |
Seems like gatsby-netlify-cms being the issue. I'll cook up a fix. Sorry for the inconveniences |
#15191 seems to be ready to get merged! |
@wardpeet can you explain why this plugin specifically is an issue? Is it purely its size? |
The PR I raised just adds that exclusion back in to the plugin's Webpack config. Please don't override your node max file size limit to fix this! |
I ran into this today as well:
It happens for a large markdown file (exactly this long read blog post which I want to transfer from my old Hugo website to my new Gatsby website). In Gatsby I use PrismJS and MDX. The 1600th line of markdown kills it. So I am not entirely sure whether it is related, because I am not using Netlify. If not related, I am happy to open a new issue. My dependencies:
Before I had Gatsby 2.3.25 and ran into the same issue (in case we want to exclude a regression bug). Then I updated full of hope that a new version would resolve it. |
Gatsby 2.12.x seemed to of fixed all of my issues |
I am following the Gatsby tutorial from https://www.netlifycms.org/docs/gatsby/ |
@wernerglinka netlify-cms changed the name of it's package to netlify-cms-app. That may be affecting you, not sure. |
Having same issue here. |
This was fixed - are you sure it's the same exact issue? Also make sure you have the latest version of both Gatsby and the Netlify CMS Gatsby plugin. Sent with GitHawk |
Thanks Alex,
I updated to netlify-cms-app and everything works.
Werner
…Sent from my iPad
On Jul 4, 2019, at 19:20, Alex Moon ***@***.***> wrote:
@wernerglinka netlify-cms changed the name of it's package to netlify-cms-app. That may be affecting you, not sure.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I added the environment variable --max-old-space-size=4096 to netlify and managed a successful build. I deleted lock files deleted node_modules and re-installed. Same issue as far as I can `see.
|
Can you help us reproduce? Repo we can clone? Sent with GitHawk |
In case it helps figure any of this out, this repo that uses Netlify CMS appears to still be broken under @erquhart I commented on your PR already on Jul 6, 2019 at 12:40 PM PDT, a few hours after your last post here: |
This worked for me <3 |
Added "(JavaScript heap out of memory)" to end of issue title just now (in addition to reopening yesterday) to try and prevent more duplicate issues like #15540 |
I just got hit with this. Gatsby version 2.13.31, Node 10.15.3 via npx and npm 6.4.1 I had imported a file that was 8mb, which was working just a few days ago. @moonmeister 's solution worked for me - increase memory with |
Description
Gatsby 2.11 breaks site build. I'm guessing it's the new functionality around building node_modules as well as the site (#14111).
i was updating dependencies on master when build started breaking. I've updated to 2.10.5 on an update branch with no troubles but as soon as I move Gatsby to 2.11 the build breaks.
Steps to reproduce
Expected result
build should be successful.
Actual result
Environment
The text was updated successfully, but these errors were encountered: