is there a way to hard restart the app? if i change an api file need to restart manually

if i change a backend or api file wasp wants me to go manually restart, anyway around this requirement? can i set up my own nodemon?
7 Replies
kapa.ai
kapa.ai6d ago
Hi @devrim. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
MEE6
MEE66d ago
Wohooo @devrim, you just became a Waspeteer level 4!
kapa.ai
kapa.ai6d ago
---------------------- Yes, Wasp has a built-in feature to automatically restart the app when changes are made to the source files. When you run the wasp start command, it launches the Wasp app in development mode and watches for any changes to .wasp or files in src/ to automatically reflect in the browser. It also shows messages from the web app, the server, and the database on stdout/stderr. Here is the command:
wasp start
wasp start
However, there have been some issues reported by the community where the app rebuilds after every UI change, which can disrupt the workflow. The Wasp team is aware of this and is working on a solution. One proposed solution is to introduce a delay between detecting a file change and running the recompilation, similar to how nodemon works. If you're experiencing issues with hot reloading, you might want to try the wasp clean command, which removes all generated code and other cached artifacts. If you're using SQlite, it also deletes the SQlite database. Here is the command:
wasp clean
wasp clean
Please note that these commands should be run in the root directory of your Wasp project. Sources: - Wasp CLI Reference (https://wasp-lang.dev/docs/general/cli#project-commands) - Discord support thread: Hot Reloading? (https://discord.com/channels/686873244791210014/1213985542480597022) - Discord support thread: Possibility to disable wasp reload on UI file changes? (https://discord.com/channels/686873244791210014/1223304305206099969) - Github Issue: Introduce a delay (e.g. 1s) for recompilation upon file change (https://github.com/wasp-lang/wasp/issues/191) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @devrim, 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?
devrim
devrim6d ago
@kapa.ai that is not my question, it does restart but doesn't take in the changes.
kapa.ai
kapa.ai6d ago
Let me check the knowledge base for you. One moment! :books: ---------------------- I see, you're saying that Wasp does restart, but it doesn't reflect the changes you made in the API files. This seems to be a known issue with Wasp. The Wasp team is aware of this and they are actively working on it. In the meantime, you might want to try manually stopping and restarting the Wasp server using the wasp start command each time you make changes to the API files. I understand this is not ideal, but it might be a temporary workaround until the issue is resolved. If you're interested in the progress of this issue, you can follow it on the Wasp Github page. Here are some relevant discussions and issues: - Discord support thread: Possibility to disable wasp reload on UI file changes? (https://discord.com/channels/686873244791210014/1223304305206099969) - Github Issue: Introduce a delay (e.g. 1s) for recompilation upon file change (https://github.com/wasp-lang/wasp/issues/191) I'm sorry for the inconvenience, and thank you for your patience as the Wasp team works on this issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @devrim, 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?
martinsos
martinsos5d ago
@devrim that shouldn't be happening, sounds like sometihng is wrong! Can you tell us about your setup? Are you maybe on WSL on Windows? If so, your source files must be on linux file system, not on windows file system, that is a bug in WSL2. If not, let us know what is your setup and we will try to figure it out. Also, do you get refreshing working for frontend/client files? Any special errors you might be getting?
devrim
devrim2d ago
hi @martinsos just using mac.. i can send you a loom if you like, but plainly if i have an endpoint defined in main.wasp, it's file is on src/x/y.tsx it won't get updated unless i ctrl-c + wasp start even though, it picks up on file change, seems to reload everything. if it's a client file, it does update. no errors
Want results from more Discord servers?
Add your server