From 105ae8cd5ad0aceaf8c8782838f32f1b953abdb5 Mon Sep 17 00:00:00 2001 From: Jory Irving <46251616+joryirving@users.noreply.github.com> Date: Fri, 14 Aug 2026 06:50:13 -0600 Subject: [PATCH] fix(build): pin NODE_ENV=production in the build script `next build` always emits a production build, but Next resolves React through the "development" export condition when NODE_ENV=development is inherited from the caller. The prerender worker then loads a second React copy, and rendering fails with "Cannot read properties of null (reading 'useContext')" on /_global-error and /automation. Pinning NODE_ENV in the script makes the build independent of the ambient value, matching the existing lint/test/typecheck scripts. Signed-off-by: Jory Irving Claude-Session: https://claude.ai/code/session_01YSuDvZq9ncvyX85Uzx3cQh --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f3ecc72..cb78bbb 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ }, "scripts": { "dev": "next dev", - "build": "next build", + "build": "NODE_ENV=production next build", "start": "next start", "audit": "npm audit --omit=dev --audit-level=high", "lint": "NODE_ENV=development eslint .",