Skip to content

fix: make build script work on Windows#278

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
sevencat2004:fix/windows-build-script
May 29, 2026
Merged

fix: make build script work on Windows#278
ralyodio merged 1 commit into
profullstack:masterfrom
sevencat2004:fix/windows-build-script

Conversation

@sevencat2004
Copy link
Copy Markdown
Contributor

@sevencat2004 sevencat2004 commented May 28, 2026

Summary

  • fix the build script so it does not rely on POSIX-only NODE_OPTIONS=... assignment
  • add a small cross-platform Node wrapper that passes the existing 1024 MB old-space limit through NODE_OPTIONS before running next build
  • avoid adding a new dependency or hardcoding Next.js internal entry-point paths

Fixes #277

Payment

  • Solana wallet: Dy4yMkjCfupxaURt6iTMUrxqSDEmAJPPkKF66QahxJZD

Test plan

  • cmd /c npm run build before the change fails immediately with 'NODE_OPTIONS' is not recognized as an internal or external command, operable program or batch file.
  • cmd /c npm run build after the change reaches the next build launch path; in this fresh checkout it then stops because dependencies are not installed (next is missing)
  • node --check scripts/build-next.js

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 28, 2026

Greptile Summary

This PR fixes the npm run build command so it works on Windows by replacing the POSIX-only NODE_OPTIONS=... next build inline assignment with a small cross-platform Node.js wrapper script that sets the env var before spawning Next.js.

  • package.json: build script now delegates to node scripts/build-next.js instead of using the shell inline env-var syntax.
  • scripts/build-next.js: merges any pre-existing NODE_OPTIONS with --max-old-space-size=1024 and calls next build via spawnSync with shell: true, correctly propagating the exit code.

Confidence Score: 5/5

Safe to merge — the change is a straightforward cross-platform fix with correct exit-code propagation and no functional regressions on POSIX.

The wrapper script is simple, correctly inherits the full environment, and properly forwards the child process exit code. The only nuance is that appending --max-old-space-size=1024 after an existing NODE_OPTIONS that already contains the flag could silently cap a higher custom limit, but this is an edge case unlikely to affect normal CI or developer workflows.

scripts/build-next.js — the NODE_OPTIONS merging logic could override a caller-supplied higher heap limit.

Important Files Changed

Filename Overview
package.json Build script updated from POSIX inline env-var assignment to cross-platform Node.js wrapper; all other scripts unchanged.
scripts/build-next.js New cross-platform build helper that merges NODE_OPTIONS and spawns next build via spawnSync; appending --max-old-space-size=1024 last could silently cap a higher limit already in NODE_OPTIONS.

Reviews (2): Last reviewed commit: "fix: make build script work on Windows" | Re-trigger Greptile

Comment thread package.json Outdated
@sevencat2004 sevencat2004 force-pushed the fix/windows-build-script branch from fbbb398 to 3ca1625 Compare May 28, 2026 09:32
@ralyodio ralyodio merged commit e9b67ec into profullstack:master May 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm build fails on Windows due to POSIX NODE_OPTIONS syntax

2 participants