Web build

JavaScript heap out of memory

The web build ran out of memory

JavaScript heap out of memory. Node hit its default memory limit while bundling. Big apps and source maps can go over it.

Updated

What this error means

Node hit its default memory limit while bundling. Big apps and source maps can go over it.

Why it happens

Node’s default heap is not enough for this production bundle. The process is killed while Vite or another bundler is still building.

The message tools print

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

How to fix it

  1. Raise the limit for the build step: NODE_OPTIONS=--max-old-space-size=4096.
  2. Turn off production source maps if you don’t need them.

Check a log that shows this

Paste the failing step into the build error explainer. It matches this message, and any others in the same log, in your browser. Nothing is uploaded.

Other Web build errors

Build the web app before the native one

CapWrapp installs dependencies from the lockfile, builds the site, and runs Capacitor sync before the native build, from the GitHub repo you connect.

  • Free to start
  • No credit card
  • Sign in with Google or GitHub