W
Wasp-lang•3w ago
cmilazzo

rebuild project on file change

Is there a way to force wasp to rebuild all the code without having to do a full clean? Replacing all the node modules takes way too long!
9 Replies
kapa.ai
kapa.ai•3w ago
Hi @cmilazzo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, Wasp provides a way to rebuild your project on file changes without having to do a full clean. When you run wasp start, it launches your Wasp app in development mode. This command automatically watches for any changes to .wasp files or files in the src/ directory and reflects those changes in the browser. This means that your project is rebuilt each time you make a change to these files, without having to replace all the node modules. However, if you're experiencing issues with the rebuild process, such as unnecessary rebuilds or file changes not being detected, these could be due to known issues with Wasp's file watching procedures. For example, there have been reports of Wasp trying to copy temporary files that no longer exist, causing it to crash, or not detecting file changes when running in WSL2 on a Windows file system. There's also an open issue to investigate how file watching works in Wasp, particularly with the restructuring in Wasp 0.12.0. If you're experiencing any of these issues, you might want to follow the progress on these issues or contribute to the discussion: - Issue #191: Introduce a delay (e.g. 1s) for recompilation upon file change (https://github.com/wasp-lang/wasp/issues/191) - Issue #61: On file change, Wasp generator tries to copy a temp file which disappears and makes it crash (https://github.com/wasp-lang/wasp/issues/61) - Issue #604: RFC: Wasp IDE Integration (https://github.com/wasp-lang/wasp/issues/604) - Issue #1844: Investigate how our file watching works (https://github.com/wasp-lang/wasp/issues/1844) - Issue #603: File changes not detected by wasp start in WSL2 when using the Windows filesystem (https://github.com/wasp-lang/wasp/issues/603) For more information on Wasp's CLI commands, you can refer to the Wasp CLI Reference (https://wasp-lang.dev/docs/general/cli#project-commands). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @cmilazzo, 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?
Filip
Filip•3w ago
Yes, I believe you can just delete the .wasp folder:
rm -r .wasp
rm -r .wasp
It's still going to install some dependencies (for Wasp's inner workings), but will not reinstall user dependencies.
cmilazzo
cmilazzo•3w ago
Thank you sodic. This will help a lot on my AWS free tier server. :). It's a very tiny machine and takes forever to do some of these operations.... But it's great for testing out a "real" production system before going live...
miho
miho•3w ago
What's your setup like on AWS? Which AWS services are you using e.g. EC2, RDS...? 😄 - I'm just curious, unrelated to the question
cmilazzo
cmilazzo•3w ago
It's an EC2 instance
MEE6
MEE6•3w ago
Wohooo @cmilazzo, you just became a Waspeteer level 4!
cmilazzo
cmilazzo•3w ago
I am actually a bit unsure of how to really deploy it though. Right now I just have github installed and actually build on the production machine, which is definitely NOT how it should be done, but it got me up and running so I can show the prototype to partners. However, I do need to go through the whole process of building a real deploy process and controlling it. I'm a bit surprised there isn't any documentation on how to deploy wasp to a regular Linux box TBH. Maybe I should write that as I figure it out (I've been keeping notes, so shouldn't be too hard to document once I get it correct). The biggest question I have is once I run the wasp build, what do I need to package up and deliver to the prod machine? Is it everything under .wasp/out, or just a subset of that?
miho
miho•3w ago
FYI we just wrote some instructions on deploying to a VPS https://gist.github.com/infomiho/80f3f50346566e39db56c5e57fefa1fe We also played around with Caprover PaaS and have a Github action: https://github.com/wasp-lang/deploy-to-caprover-action/tree/main And of course, some docs on manual deployment for more general concepts: https://wasp-lang.dev/docs/advanced/deployment/manually In a nutshell, Wasp is just React + Node.js + Postgres, what ever works for that combo, works for Wasp 🙂
cmilazzo
cmilazzo•3w ago
Thanks @miho!
Want results from more Discord servers?
Add your server