Hello! I recently set up my local environment to contribute to freecodecamp. I used “pnpm run develop” to spin up everything and the first time it took over a day (not kidding thats what the terminal said) to finish building development bundle and caching html renderer. After it finished loading, I was able to see the website at localhost:8000. Then I turned off my computer thinking the next spin up would be much quicker, but when I tried to build it again with pnpm run develop its been taking the same amount of time. Is this normal? Does that mean I cant turn off my laptop otherwise the build time would be 24 hours again?
Im developing on a 2021 razor laptop with Intel(R) Core™ i7-10875H CPU @ 2.30GHz and 16GB of memory
That certainly does not sound right. Did you follow the setup instructions in the guide?
What OS are you using?
Recently I have been using Gitpod mainly and it has been a hot minute since I last ran it locally. I got a new system and have not yet tried using the WSL2 setup, so I can’t really comment on the current state of using it locally. But I’m sure it isn’t supposed to take very long to run the build.
Yes I have followed the steps listed, it is synced with git, created the .env with “cp sample.env .env”, ran “pnpm install && pnpm run create:config”, seeded mongo, and was able to visit localhost:8000 which showed the website successfully. Its just that
“pnpm run develop” took 24 hours to finish loading the app and stalled at building development bundle and caching html renderer.
I think I might look into Gitpod to get around this
Specifically, by default WSL would take 8GB from your memory, and then probably 4GB swap. Our dev build is quite a memory hog, and often eats more than 8GB. So, you are likely running out of memory, and if your swap is an HDD, then I would not be surprised with extensive develop times.
The short of it:
Wherever your root user is on Windows, create a .wslconfig file
Within the .wslconfig file, add something like:
[wsl2]
memory=12GB
NOTE: If you allocate 16GB to WSL, you will have NO memory left for Windows - it will be unstable at best.