-
-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Update package.json for memory Heap issue #6342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,10 @@ | |
| "scripts": { | ||
| "build": "turbo run build", | ||
| "build-force": "pnpm clean && turbo run build --force", | ||
| "dev": "turbo run dev --parallel", | ||
| "dev": "NODE_OPTIONS='--max-old-space-size=8192' turbo run dev --parallel", | ||
| "start": "run-script-os", | ||
| "start:windows": "cd packages/server/bin && run start", | ||
| "start:default": "cd packages/server/bin && ./run start", | ||
| "start:default": "cd packages/server/bin && NODE_OPTIONS='--max-old-space-size=8192' ./run start", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoding |
||
| "clean": "pnpm --filter \"./packages/**\" clean", | ||
| "nuke": "pnpm --filter \"./packages/**\" nuke && rimraf node_modules .turbo", | ||
| "format": "prettier --write \"**/*.{ts,tsx,md}\"", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change introduces two significant issues: 1. Cross-platform compatibility: The
NODE_OPTIONS='...'syntax is shell-specific and will fail on Windows Command Prompt (CMD). Since the project explicitly supports Windows (as seen in thestart:windowsscript), this should be handled usingrun-script-osor a cross-platform utility. 2. Resource Exhaustion: Setting a high memory limit at the root level while usingturbo --parallelmeans every task spawned by Turbo will inherit this 8GB limit. In a monorepo, this can quickly lead to system-wide Out-Of-Memory (OOM) errors if multiple tasks run concurrently. It is safer to apply this limit only to the specific package that requires it.