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
Workaround for Javascript heap out of memory errors
Added workaround to deal with heap out of memory issues, which will happen for a reasonable sized app built on {N}.
Please see NativeScript/nativescript-dev-webpack#458
**NOTE** Windows environment variable setting has not been tested by me - please confirm / verify it for Windows. macOS / Linux has been verified to work.
Bundle processing can consume a significant amount of memory, specically when using uglify `--env.uglify`. The default node process allocates 1.5GB memory. If you encounter issues similar to:
425
+
`FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory`
426
+
427
+
Please set the following environment variable to allocate a larger heap size before running `tns build --bundle`, e.g. to allocate 4GB memory:
428
+
For macOS / Linux:
429
+
`export NODE_OPTIONS=--max-old-space-size=4096`
430
+
For Windows:
431
+
`set NODE_OPTIONS=--max-old-space-size=4096`
432
+
420
433
### Inspecting Bundles
421
434
422
435
Bundles are generated in the platform output folders. Look for the `bundle.js` and `tns-bundle.js` files in your `platforms/android/...` and `platforms/ios/...` "app" folders. You could change the destination directory by editing your configuration.
0 commit comments