scalajs-bundler icon indicating copy to clipboard operation
scalajs-bundler copied to clipboard

JavaScript heap out of memory on bundling

Open ngbinh opened this issue 8 years ago • 2 comments

I am trying to use scalajs-bundler on our fairly big project and seeing this

[info 11:47:43:PM] Bundling the application with its NPM dependencies
[info 11:48:25:PM]
[error] FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
[error 11:48:25:PM] FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Looks like related to https://github.com/webpack/webpack/issues/2157, is there a way to pass --max_old_space_size=4096 flag to node using this plugin?

ngbinh avatar Feb 12 '17 16:02 ngbinh

I guess this would work:

jsEnv := NodeJSEnv(args = Seq("--max_old_space_size=4096)).value

sjrd avatar Feb 12 '17 17:02 sjrd

@sjrd, I'm not sure that would help: https://github.com/scalacenter/scalajs-bundler/blob/dddad3568a50e67c8d559c1aedaf4ef0c61ee6e3/sbt-scalajs-bundler/src/main/scala/scalajsbundler/Webpack.scala#L125-L126

nigredo-tori avatar Feb 13 '17 00:02 nigredo-tori