Taking forever to spin-up/build/load freecodecamp on local

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.

Gitpod is perfectly fine for a few one-off PRs.

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

I am using WSL2 on Windows 11

Where are you cloning the repo? There is a note and issue about using shared folders.

I just set it up and it didn’t give me any issues, the first-time setup was acceptable and later runs were pretty fast (less than a minute).

I should say I’m on Windows 10 but as far as I know, WSL2 is supposed to be better on 11.

In any case, I think the Gitpod workflow is pretty good so I would check that out as well.

Welcome there,

One thing you might want to check is the amount of memory you have allocated for WSL: Advanced settings configuration in WSL | Microsoft Learn

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:

NOTE: If you allocate 16GB to WSL, you will have NO memory left for Windows - it will be unstable at best.

Hope this helps

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.