Closed miek770 closed 1 year ago
Interesting, I have never encountered this. This looks like a yarn / node thing. I wonder if it is a result of your huge library somehow?
I see you're running yarn run
and not yarn build
. Do you get the same thing with yarn build
?
Can you give this a try? from within the web
folder?
export NODE_OPTIONS="--max-old-space-size=4096" yarn build
Interesting, I have never encountered this. This looks like a yarn / node thing. I wonder if it is a result of your huge library somehow?
I'm sure it is! I might have to break it up in a few sublibrairies, but for now I'll keep trying.
I see you're running
yarn run
and notyarn build
. Do you get the same thing withyarn build
?
No it's just how yarn reports it, I'm simply running generate_site.sh
:
(app) fussel@odroid:~/app/fussel$ cat generate_site.sh
#!/usr/bin/env bash
set -e
SCRIPT_PATH="${BASH_SOURCE[0]}"
CURRENT_PATH=$(dirname $SCRIPT_PATH)
cd $CURRENT_PATH
# Generate site
./fussel.py
# Rebuild node site
pushd web
yarn build
popd
printf "Site generated at: ${CURRENT_PATH}/web/build"
printf "\n\n To validate build run: \n python -m http.server --directory web/build\n\n"
(app) fussel@odroid:~/app/fussel$ pushd web
~/app/fussel/web ~/app/fussel
(app) fussel@odroid:~/app/fussel/web$ NODE_OPTIONS="--max-old-space-size=8192" yarn build
yarn run v1.22.4
$ react-scripts build
I'm running it again with NODE_OPTIONS="--max-old-space-size=2048" yarn build
from here instead of your suggestion (it didn't seem to do anything, the command just exited with no output). I'll see if it works or if more memory is required. It's weird, I got the impression that it didn't want to use my swap and just failed when called with anything bigger than 2048.
From here I see the max memory in node.js is set to 512 MB by default.
Last bit of info until the command finishes:
michel@odroid:/home/fussel/app/fussel/web$ free -mh
total used free shared buff/cache available
Mem: 1.9G 678M 46M 106M 1.2G 1.1G
Swap: 2.0G 210M 1.8G
Yay it worked! I probably wouldn't change the script but would add something about this issue in the readme's installation procedure.
My thoughts exactly. Thanks a lot for testing this!
You're welcome, thanks for the great app! Please feel free to close this issue when you want.
Update the FAQ in the README in v2
Hi again,
This is the latest hickup I got. As mentioned in the title, I'm not sure it's really a fussel issue but I document it here for the time being:
Retried, got it again:
From here, it looks like
--max-old-space-size
should be increased to allow more memory usage. I have 2GB of RAM plus 2GB of swap, but the latter could easily be increased to whatever I need to build the site. I'm trying to find where to up this limit in the code but might not be quick about it.