Exit code 9 from Node.js means "Invalid argument", not SIGKILL/OOM.
--no-require-module was added in Node 22.12.0 — the cached node:22-slim
image on the VPS predates that release so Node rejects the flag immediately.
The minimal migrate.ts doesn't load lexical/form-builder, so there are no
TLA/ESM issues that required the flag in the first place.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pnpm payload migrate exits 1 in the migrator container likely due to TLA
issues with Lexical packages (same issue seen with migrate:create).
Replace with a small src/scripts/migrate.ts that calls payload.db.migrate()
programmatically, using the same NODE_OPTIONS approach that works for seed.ts:
NODE_OPTIONS="--experimental-strip-types --no-require-module"
Also add migrator log output to the CD workflow for easier debugging.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Build stage runs pnpm build which changes ESM resolution context.
New migrator stage has deps+src only — clean env for tsx/payload migrate.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>