Build timeout with error ENOMEM in Amplify

0

I have a Next.js 14 application, my Amplify builds randomly timeout after 30minutes with the following error:

ESLint: ENOMEM: not enough memory, read

When it does not fail it usually builds after 7 minutes. I have tried increasing NODE_OPTIONS=--max-old-space-size=8240 but that doesn't seem to help

Jose
asked 24 days ago60 views
1 Answer
0

Hi there,

Quick Fixes:

  1. Upgrade Build Environment:

    • Use a larger build instance in the Amplify console for more memory.
  2. Optimize Build Process:

    • Reduce memory usage by optimizing your build, like limiting files or splitting tasks.
  3. Increase Memory Allocation:

    • Set NODE_OPTIONS="--max-old-space-size=12288" to increase memory for the build.
  4. Disable ESLint:

    • Temporarily disable ESLint during the build by setting:
      CI=true npm run build
  5. Check Logs:

    • Review the Amplify build logs to find where memory spikes.

Hope this helps! 😁

Daher
answered 24 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions