devsoap / ds-gradle-vaadin

Gradle plugin for building Vaadin Flow 10/11/12/13/14/15 apps
https://devsoap.com/gradle-vaadin-flow-plugin
Other
36 stars 13 forks source link

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory #217

Closed PabloIT closed 5 years ago

PabloIT commented 5 years ago

In a large project, when productionMode = true, an error occurs:

image

The solution may be to increase or to set the parameter for the node: --max-old-space-size

Example of the yarn.cmd file:

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe" "--max-old-space-size=8192" "%~dp0\node_modules\yarn\bin\yarn.js" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node "--max-old-space-size=8192" "%~dp0\node_modules\yarn\bin\yarn.js" %*
)
johndevs commented 5 years ago

Could you try adding the following to your build.gradle and see if it works?

vaadinTranspileDependencies.yarnRunner.environment.put('NODE_OPTIONS', '--max-old-space-size=8192')
PabloIT commented 5 years ago

I confirm, the given solution works well. Thanks.