-
Notifications
You must be signed in to change notification settings - Fork 122
JS heap out of memory when bundling #832
Comments
Since you're using JSPM, does this work if you run build commands from the CLI? This might help track down the issue. $ jspm build app --minify --format iife Also, strongly consider configuring TypeScript to output either Note that when using JSPM, rather than consuming the SystemJSBuilder API directly, you should instead acquire a pre-configured builder as in var Builder = require('jspm').Builder;
var builder = new Builder(); This results in a SystemJSBuilder instance pre-configured with JSPM config that can be further customized as needed. |
Hm, I have not tried using JSPM CLI to build the app but in very short, it does not work. Changing the module format to I am preparting a minimum repository to share. |
Okay, I found out a bit more. I am now trying to bundle using JSPM like this:
When I removed the import for Kendo UI ( I tried to reproduce this in a minimal example using the free OpenSource variant of Kendo UI but there the issue does not seem to happen. Then I tried to exclude Kendo UI from the main bundle but that does not work either.
It also produces heap out of memory. Also tried Any ideas how to solve this? |
What happens if you run $ jspm build kendo.all.min.js ? |
Another update: Bundling with Kendo UI works if I use |
Running
|
I must add that deactivating the sourcemaps looks like only a temporary workaround. After the project got a little bigger I started to run into the heap out of memory issue again, especially when multiple gulp tasks are chained. I can work around it by increasing the NodeJS memory limit (i.e. |
@ZoolWay thank you for keeping this up to date and reporting your findings. If you are running gulp tasks in a single process such that multiple bundling operations are potentially interleaved, you may indeed run into issues. |
What is the recommended process around this (although giving it just 4GB RAM might be a normal solution too)? Can in series running gulp tasks be forked into own processes? |
Yes you can fork them, but running them sequentially should also do the trick. Consider using |
Hi! I am trying to bundle the components of my application but SystemJS Builder runs quite long and then I get
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
.I do not think my project is huge but all js, html, json and css files together make up 612 files (collected by globby).
I am using JSPM 0.17.0-beta.44 with SystemJS 0.20.18, SystemJS Builder 0.16.10, Plugin CSS 0.1.35, Plugin JSON 0.3.0 and Plugin Text 0.0.11. No transpilation by SystemJS involved (my gulp task utilizes typescript and SystemJS just reads the output js files), the JS code is ES6 in AMD format.
Complete error:
The security context is not always the same, here is another variant:
The text was updated successfully, but these errors were encountered: