How long does it take to compile on WSL2?
I am wondering if I have a misconfiguration. It has been compiling for about ~15 min. Appreciate any feedback!

5 Replies
Hi @Landyn. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources, compilation time in WSL2 can vary significantly, and several users have reported long compilation times or hanging issues. This could be due to several factors:
1. Resource limitations: One user mentioned that their VPS with only 512MB RAM was causing compilation to hang or take extremely long. WSL2 resource allocation might be a factor in your case as well.
2. File system location: If your Wasp project is located on the Windows file system (e.g., in
/mnt/c/
) rather than the Linux file system, this can cause significant performance issues. This is a known issue with WSL2 that affects not just Wasp but any application trying to detect file changes on the Windows filesystem from WSL2.
As mentioned in the documentation: "If you are using WSL2, make sure that your Wasp project is not on the Windows file system, but instead on the Linux file system. Otherwise, Wasp won't be able to detect file changes, due to the issue in WSL2." Wasp Quick Start Guide
3. Docker-related issues: If you're using Docker with WSL2, some users have reported performance problems, especially for resource-intensive tasks.
To troubleshoot:
- Make sure your project is on the Linux filesystem, not in the /mnt/c/
directory
- Check if you have sufficient resources allocated to WSL2
- Try running wasp clean
before compiling again
- If it continues to hang, you might try the manual approach: run wasp compile
for a few minutes, then kill it, then manually run npm install
in the .wasp/out/web-app
and .wasp/out/server
folders to see more detailed error messages
15 minutes does seem excessive for a normal compilation, so there's likely something that can be optimized in your setup.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Landyn, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Hey @Landyn, I had similar issues some time ago. Did you read this page https://wasp.sh/blog/2023/11/21/guide-windows-development-wasp-wsl ? It is probably related with the location of your repository, it should be inside the WSL (Not in Windows disk directly). I hope it helps 😉
A Guide to Windows Development with Wasp & WSL | Wasp
<ImgWithCaption
I think that's exactly it! Thanks Ramon.
Wohooo @Landyn, you just became a Waspeteer level 1!
Hey @Landyn just wanted to know, how much time spent to compile for you? Was it a new basic app or opensaas template?