You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NX HEAP LIMIT: 8048
[NX CLOUD] Verifying current cloud bundle
[NX CLOUD] A local bundle currently exists: {
version: '2403.05.3.hotfix1',
fullPath: '.../nxtest/angular-monorepo/.nx/cache/cloud/2403.05.3.hotfix1'
}
[NX CLOUD] Last verification was within the past 30 minutes, will not verify this time
[NX CLOUD] Done: /.../nxtest/angular-monorepo/.nx/cache/cloud/2403.05.3.hotfix1
> NX --skip-nx-cache disables the connection to Nx Cloud for the current run.
The remote cache will not be read from or written to during this run.
> nx run angular-store:build:production
⠋ Building...
NG HEAP LIMIT: 4144
...
Package Manager Version
yarn v1.22.21 (but also happens with yarn 4.1.0)
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
The issue also appears in nx 18.0.0 which is blocking us from upgrading to the latest version (the test with v17.3.0 was just to narrow it down on a specific version change).
In case the described behavior is intended and there would be a new way of passing the increased heap allocation limit to the build process, learning about how this could be done would also be a solution.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
As a workaround you can use environment variables. Nx supports .env files. To apply the option to all nx commands put an .env file in your project root with the following content: NODE_OPTIONS='--max_old_space_size=8192'
As a workaround you can use environment variables. Nx supports .env files. To apply the option to all nx commands put an .env file in your project root with the following content: NODE_OPTIONS='--max_old_space_size=8192'
@ctusch thanks for the hint. I can confirm that this workaround is a possible solution and generates the expected behavior in the test case outlined above!
Current Behavior
Larger angular projects require to increase the value of the heap allocation limit beyond the default limit of ~4GB.
Up until nx version 17.2.8 it was possible to do this by using an alias for the nx executable in the
package.json
:Migrating to nx version 17.3.0, the value is no longer propagated to the angular build process and the build fails.
Expected Behavior
The angular build process should inherit the increased heap allocation limit and should allow the build to succeed.
GitHub Repo
https://github.com/hschmidtchen/nx-reproduce-memory-issue
Steps to Reproduce
angular-monorepo
projectyarn install
node_modules/nx/bin/nx.js
after the importsnode_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin.js
after the importsyarn nx build angular-store --skip-nx-cache --verbose
--> NX HEAP LIMIT will be ~8GB
--> NG HEAP LIMIT will be ~4GB indicating that the value was not propagated
--> NX HEAP LIMIT will be ~8GB
--> NG HEAP LIMIT will be ~8GB indicating that the value was correctly propagated
Nx Report
Failure Logs
Package Manager Version
yarn v1.22.21 (but also happens with yarn 4.1.0)
Operating System
Additional Information
The issue also appears in nx 18.0.0 which is blocking us from upgrading to the latest version (the test with v17.3.0 was just to narrow it down on a specific version change).
In case the described behavior is intended and there would be a new way of passing the increased heap allocation limit to the build process, learning about how this could be done would also be a solution.
Thanks in advance!
The text was updated successfully, but these errors were encountered: