Deployment Issue with Astro Application on Vercel

Hello,

I am encountering a problem with deploying my application using the Astro framework on your Vercel platform.

Issue Description

When running the astro check command, I receive an error indicating that the JavaScript heap is out of memory, and the process ends with a memory allocation error.

Technical Details

  • Project:*MonComptoirSecret
  • Framework: Astro
  • Node.js: v20.15.0
  • Error: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

Steps Already Taken

  1. I attempted to increase the memory allocated to Node.js using NODE_OPTIONS=--max_old_space_size=8192, but the error persists.
  2. I ran analyses with clinic doctor, but the generated report contained no usable data.

Request for Assistance

I am seeking your assistance to:

  1. Diagnose the cause of this memory issue during deployment.
  2. Obtain advice or solutions to resolve this issue and successfully deploy my application.

Thank you in advance for your valuable assistance. If you need more details or additional information, I am at your disposal.

Thanks for reaching out, @mickaelsanches!

I want to make sure you’re not completely stuck while you try more permanent solutions. You should be able to deploy from a local build using vercel build && vercel deploy --prebuilt as a temporary workaround.

Some people with similar build issues have had success by changing the max_old_space_size to something below the 8192 MB build container memory. Does it work if you change it to NODE_OPTIONS=--max_old_space_size=6144?

If that doesn’t work, you should try the other suggestions in this guide: JavaScript heap out of memory with Astro and GitHub Actions | Steve Fenton. The suggests are useful even though the original guide was written for GItHub Actions rather than Vercel.

Please let me know whether any of that solves it for you. :pray:

Hi amyegan,
Thanks for your quick response and suggestions.

Unfortunately, I have tried the recommended solutions but without success.

I have tried to deploy from a local build using vercel build && vercel deploy --prebuilt, but the issue persists.
We have also changed max_old_space_size to 6144 MB using NODE_OPTIONS=–max_old_space_size=6144, but the build still fails with the same out of memory error.
Additionally, we have looked at the suggestions in Steve Fenton’s guide to handling JavaScript heap out of memory issues with Astro and GitHub Actions. Despite following these steps, the issue remains unresolved.
Will upgrading to Pro make any difference? Or should I move to a more complex hosting provider than Vercel?

Given the critical nature of this project, I am looking for further assistance in overcoming this hurdle. Any additional information or alternative solutions you could provide would be greatly appreciated.

Thank you for your continued support.

Does the build fail on your local machine? Or is it failing on the deployment step?

On both… At first I didn’t do it locally because the synchronization was done via commits. When it stopped working I tried locally and failed on both and the same after everything you sent me…

That’s not what I would have expected. :thinking: Does astro build also run into the same error? If you run vercel build alone, does that fail?

I wasn’t able to reproduce the issue with an Astro boilerplate project. I also tried following the Deploy your Astro Site to Vercel guide, and it worked for my small example app. If you share a minimal reproducible example, that would help me see the error myself so I can dig into the details.

Well… The deployment works overnight, but it is done ultra quickly and the production site is in 404 NOT FOUND… I don’t understand anything anymore

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.