Immutable solution version
Zod v4 causes 'JavaScript execution ran out of memory (64 MB)' during push , 5-13x higher per-schema memory allocation
Complete solution
Shows how to fix zod v4 causes 'JavaScript execution ran out of memory (64 MB)' during push , 5-13x higher per-schema memory allocation. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
For "JavaScript execution ran out of memory (maximum memory usage: 64 MB)": change only zod to ^4.2.1 in package.json` (no code changes) → OOM ❌ 4. Convex changed how it analyzes code during push: entrypoints are now analyzed independently, so large Zod v4 schemas no longer blow the 64 MB push memory limit.
JavaScript execution ran out of memory (maximum memory usage: 64 MB)Steps
- Convex changed how it analyzes code during push: entrypoints are now analyzed independently, so large Zod v4 schemas no longer blow the 64 MB push memory limit. Make sure you are on the latest convex version. If you still hit memory pressure from huge schemas, switching to zod-mini buys headroom, but the analysis change should unblock pushes.
When to use
You are seeing this: Issue get-convex/convex-backend#414 (closed, 21 comments): ## Summary After upgrading from Zod v3 to v4, npx convex dev fails with: ` JavaScript execution ran out of memory (maximum memory usage: 64 MB) The bundle is actually smaller with zod v4, but... Use this skill when you run into "Zod v4 causes 'JavaScript execution ran out of memory (64 MB)' during push , 5-13x higher per-schema memory allocation".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: zod 3.25.76, 4.2.1. If you are on something much newer or older, the details may have shifted.
Variants
Other phrasings of the same problem that show up in reports:
JavaScript execution ran out of memory (maximum memory usage: 64 MB)
``` JavaScript execution ran out of memory (maximum memory usage: 64 MB) ```Why this happens
Ran out of memory (maximum memory usage: 64 MB) ` The bundle is actually smaller with zod v4, but runtime memory during module analysis exceeds 64 MB due to zod v4's significantly higher per-schema memory allocation. ## Reproduction 1.
Evidence
In gh:get-convex/convex-backend#414 (Convex), the issue reported was: Issue get-convex/convex-backend#414 (closed, 21 comments): ## Summary After upgrading from Zod v3 to v4, npx convex dev fails with: `` JavaScript execution ran out of memory (maximum memory usage: 64 MB) The bundle is actually **smaller** with zod v4, but runtime memory during module analysis exceeds 64 MB due to zod v4's significantly higher per-schema memory allocation. ## Reproduction 1. Large Convex project with ~400 isolate modules and hundreds of zod schema definitions 2. npx convex dev works with zod@^3.25.76 ✅ 3. Change only zod to ^4.2.1 in package.json` (no code changes) → OOM ❌ 4. Revert → works again ✅ ## Our Measurements * The verified resolution from the thread: Convex changed how it analyzes code during push: entrypoints are now analyzed independently, so large Zod v4 schemas no longer blow the 64 MB push memory limit. Make sure you are on the latest convex version. If you still hit memory pressure from huge schemas, switching to zod-mini buys headroom, but the analysis change should unblock pushes. Source: mount the host path https at container path //github.com/get-convex/convex-backend/issues/414
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_JxocyFzxezMaDCkTGoY0oQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Zod v4 causes 'JavaScript execution ran out of memory (64 MB)' during push , 5-13x higher per-schema memory allocation <span>— Vectle</span></a>