From 069c7fdc2808c863aa6505fe540fdfb4d7943fd5 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Tue, 4 Jan 2022 18:04:28 +0100 Subject: [PATCH 1/2] Fix: JavaScript heap out of memory #29 --- scripts/_common.sh | 2 ++ scripts/install | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 19e6d2c..172122c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -19,6 +19,8 @@ NODEJS_VERSION="15.11.0" SOURCE="https://github.com/standardnotes/web" COMMIT="e856ce7bfd3a7b357544e43ca343b1ec861debb3" +node_max_old_space_size=2048 + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 677b9db..7a7ef11 100644 --- a/scripts/install +++ b/scripts/install @@ -162,8 +162,8 @@ pushd "$final_path/live" ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set --local path 'vendor/bundle' ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set with 'development' ynh_exec_warn_less "ynh_exec_as $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet" - ynh_exec_warn_less "ynh_exec_as $app env PATH=$ynh_node_load_PATH yarn install --pure-lockfile" - ynh_exec_warn_less "ynh_exec_as $app env PATH=$ynh_node_load_PATH yarn bundle" + ynh_exec_warn_less "ynh_exec_as $app env NODE_OPTIONS=\"--max-old-space-size=$node_max_old_space_size\" PATH=$ynh_node_load_PATH yarn install --pure-lockfile" + ynh_exec_warn_less "ynh_exec_as $app env NODE_OPTIONS=\"--max-old-space-size=$node_max_old_space_size\" PATH=$ynh_node_load_PATH yarn bundle" ynh_exec_warn_less "ynh_exec_as $app $ynh_ruby_load_path bin/bundle exec rails assets:precompile --quiet" popd From 32b808f84d87113e2340bfb7da6c0db6fe365223 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Tue, 4 Jan 2022 19:14:57 +0100 Subject: [PATCH 2/2] Fix: JavaScript heap out of memory #29 --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 737bb1e..33ff967 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -182,8 +182,8 @@ then ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set --local path 'vendor/bundle' ynh_exec_as $app $ynh_ruby_load_path bin/bundle config set with 'development' ynh_exec_warn_less "ynh_exec_as $app $ynh_ruby_load_path bin/bundle install -j$(getconf _NPROCESSORS_ONLN) --quiet" - ynh_exec_warn_less "ynh_exec_as $app env PATH=$ynh_node_load_PATH yarn install --pure-lockfile" - ynh_exec_warn_less "ynh_exec_as $app env PATH=$ynh_node_load_PATH yarn bundle" + ynh_exec_warn_less "ynh_exec_as $app env NODE_OPTIONS=\"--max-old-space-size=$node_max_old_space_size\" PATH=$ynh_node_load_PATH yarn install --pure-lockfile" + ynh_exec_warn_less "ynh_exec_as $app env NODE_OPTIONS=\"--max-old-space-size=$node_max_old_space_size\" PATH=$ynh_node_load_PATH yarn bundle" ynh_exec_warn_less "ynh_exec_as $app $ynh_ruby_load_path bin/bundle exec rails assets:precompile --quiet" popd fi