known issue with reloading web app?
Frequently when I make a change to the dev code (or even deploy a new version to my production system) it will recompile, but not actually load the new code. As a test I simply put a console.error() call in to frequently used section of code. and let the auto-updater recompile. I always see this in my wasp output : π --- Recompiling on file change... -----------
However, this sometimes results in no changes (i.e. the error message does not get displayed). The problem will persist until I do a wasp clean.
14 Replies
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, there are known issues with Wasp regarding file changes not being detected and triggering recompilation.
One issue is when
wasp start
is running in WSL2 for a project on a Windows file system. It does not automatically recompile and hot-reload the web page when making changes. This is an issue with WSL2 and not Wasp itself. The recommended solution is to include this issue in Wasp documentation to help new users avoid it. It might also make sense to try to detect when a user runs wasp start
in a Windows filesystem and warn them of the issue source (https://github.com/wasp-lang/wasp/issues/603).
Another issue is that Wasp tries to copy a temp file which disappears and makes it crash. This happens when a file change is detected, Wasp CLI runs the Wasp compiler on all of the source files, and the output is written to the .wasp/out directory. If there are rapid changes of files after one another, Wasp recompilation might be triggered multiple times in a fraction of a second, which is redundant. A proposed solution is to introduce a delay between detecting a file change and running the recompilation source (https://github.com/wasp-lang/wasp/issues/191).
There's also an issue where the entire app recompiles and refreshes the client server page, losing all state, every time an API call is made. This should only be happening on actual file changes source (https://github.com/wasp-lang/wasp/issues/1881).
Lastly, there's an issue where the browser tab goes blank after file changes. This happens when something runs in parallel with CRA, CRA creates this empty tab because it finishes too soon and does not catch some of the changes source (https://github.com/wasp-lang/wasp/issues/84).
If you're experiencing any of these issues, you might want to try the proposed solutions or follow the progress on the linked Github issues.
----------------------
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?None of these are my situation. I am running on Linux, and this is a single file changing. The client server page does not lose all state.
@kapa.ai do you have any other suggestions? My situation is a Linux server, not Windows, and it's a single file that is change so it shouldn't be related to issue 191 or issue 1881. The browser tab is also not going blank, so it's not related to issue 84
Let me check the knowledge base for you. One moment! :books:
----------------------
Based on the provided information, it seems like your issue might be related to the one described in Github Issue #620 (https://github.com/wasp-lang/wasp/issues/620). In this issue, the browser UI becomes unresponsive after the server reloads due to a code change. The error message
Uncaught ReferenceError: process is not defined
appears in the browser console when this happens.
However, if you're not seeing any error messages in your console, your issue might be different.
As a workaround, you could try manually refreshing your browser after making a code change to see if the new code loads. If the issue persists, I would recommend opening a new issue on the Wasp Github page (https://github.com/wasp-lang/wasp/issues) to get help from the Wasp community.
Please include as much information as possible in your issue description, such as your operating system, Wasp version, and a detailed description of the problem and any error messages. This will help the Wasp team diagnose and fix the issue.
----------------------
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?@kapa.ai No, Its not issue 620 either. The browser UI continues to work fine. The only symptom is that file changes do not propogate to the web app.
Let me check the knowledge base for you. One moment! :books:
----------------------
I see, it seems like your issue is quite specific and not directly covered by the known issues I've mentioned earlier.
The problem you're experiencing might be due to some caching mechanism either in your browser or in the Wasp build process. Here are a few things you could try:
1. Clear your browser cache: Sometimes, browsers cache files for performance reasons and don't fetch the updated versions. Try clearing your browser cache or use an incognito window to see if the changes are reflected.
2. Restart the Wasp server: If the changes are not being picked up, try stopping the Wasp server (
Ctrl+C
in the terminal where it's running) and start it again with wasp start
.
3. Use wasp clean
: You mentioned that wasp clean
solves the issue. This command cleans the .wasp/out
directory which is where Wasp generates the code. You might need to use this command more frequently if the changes are not being picked up.
If none of these workarounds solve your issue, I recommend creating a new issue in the Wasp Github repository (https://github.com/wasp-lang/wasp/issues). Please provide as much detail as possible, including your operating system, Wasp version, and a detailed description of the problem. This will help the Wasp team to better understand and address your issue.
----------------------
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?Hello again @cmilazzo. You did a great job explaining the problem to the bot, but sometimes it just won't budge.
I believe we do have some issues with file watching sometimes that manifest in what you've described.
What's strange is that you have to do a
wasp clean
. Rerunning wasp start
should solve the issue.
Did you try to clean the browser's cache like kappa suggested?Also a follow up question from me: are you maybe on Windows and using WSL2?
Hey @sodic . Yes, I did try wasp start and clearing the browser cache... no luck. I'm not using Windows at all. My dev machine is a mac, and deployment is RedHat Linux (AWS).
Are you maybe working with
wasp build
, or is wasp start
misbehaving?I'm using wasp start, not wasp build.
@martinsos any ideas here?
@sodic hm not actually, this is quite unexpected.
1. @cmilazzo anything unusual in your output in the console? Any error / warning messages?
2. Do you by any case get an error in console mentioning something like "too many open files"? What happens if you increase your
ulimit
like here https://askubuntu.com/questions/1182021/too-many-open-files , does that help?
3. What if you start a new project with Wasp, a very simple one, let's say using a todo template or just basic template, how does that project behave, does it also not reload properly?
4. When did this start happening for you -> from the very start, or at some point?
5. Could you possibly provide a video of the issue happening?
THanks!Ask Ubuntu
Too many open files
when i open Lutris and then LOL client , this happening. And game never work good. I tried many things but never can change the open file limit. How can fix this ?
Waiting on children
Waiting on
Waiting on
@martinsos There's nothing unusual in the console at all. No error messages or anything. It notices a file change and supposedly recompiles, but the changes never make it to the app. And of course it's intermittent so hard to tell when it will happen. Once it happens though, it won't pick up any new updated files.
This is happening on two separate machines as well... my mac and a Redhat linux machine
Next time it happens I'll try to get more info....
Thanks @cmilazzo -> sucks that this happens, but if you will have more info we would appreciate it as it will help us fix this!