Skip to content

perf: Astro build OOM — needs NODE_OPTIONS --max-old-space-size=8192 #150

@williamzujkowski

Description

@williamzujkowski

Found during: Build testing (2026-04-01)
Severity: high

Problem

pnpm astro build OOMs with default Node.js heap (~4GB) when building all 53 titles of statutory content. The build collects 28s of content data then crashes during static entrypoint generation.

Workaround

NODE_OPTIONS='--max-old-space-size=8192' pnpm astro build

Root Cause

Building all chapter pages renders every section inline at build time. The hybrid chapter page refactor (index-by-default for >50 sections) should reduce memory pressure significantly.

Fix Plan

  1. Update apps/web/package.json build script to include NODE_OPTIONS='--max-old-space-size=8192'
  2. Update CI workflow to set the same env var
  3. Long-term: the hybrid chapter page refactor defers rendering large chapters, reducing build memory
  4. Consider Astro's server output mode for very large chapters

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions