Refresh problem
another new person question: Wasp doesn't appear to be re-compiling when I make changes to frontend source. Still following the ToDo App tutorial and I just replaced the entire contents of
MainPage.tsx
to go from a single <p>Hello world!</p>
element to rendering a list of tasks, but my terminal where wasp start
is running never changed and refreshing the page doesn't show my list. If I kill the wasp
process and do wasp start
again, everything is fine.
I do see in the terminal output that nodemon
is watching these extensions: ts,mts,js,mjs,json
but not tsx
(and also jsx
). Could that be causing this or do I need to look at something else?2 Replies
Hi @Webby Vanderhack. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
You're experiencing a common issue with hot reloading in Wasp. Based on the knowledge sources, there are a few potential causes for your frontend changes not being automatically detected and recompiled.
Possible Causes
1. File Extension Watching: You've correctly identified that nodemon might not be watching
.tsx
files. This could indeed be part of the issue.
2. WSL2 on Windows Filesystem: If you're using WSL2 and your project is on the Windows filesystem (rather than the Linux filesystem), hot reloading won't work. This is a known issue with WSL2, not specific to Wasp.
Github Issue #603
3. Recent Changes in Wasp: There have been some changes to how file watching works in recent Wasp versions, which might be affecting the hot reload functionality.
Github Issue #1844
Workarounds
For now, you'll need to restart wasp start
after making changes to see them reflected, as you've already discovered. This is a known issue that several community members have reported:
- In one Discord thread, users mentioned having to restart wasp start
for all small changes they made
Discord support thread
- Another user specifically asked about hot reloading not working like in create-react-app
Discord support thread
Additional Context
The Wasp team is aware of these issues. There have been several related GitHub issues:
- Issue #620 about UI becoming unresponsive after server reload
- Issue #84 about browser tabs going blank after file changes
If you're using WSL2, make sure your project is on the Linux filesystem rather than the Windows filesystem, as mentioned by a community member:
"Oooooh you know what -> hot reloading won't work on WSL if your project is on the Windows file system, instead of the Linux file system. SO it should be on the Linux file system. This is an issue in WSL2, has nothing to do with Wasp actually." Discord support threadThe Wasp team is actively working on improving the file watching and hot reloading experience. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Webby Vanderhack, 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?
ah crap, it's definitely using win fs from WSL 2. I tend to keep my projects on an NTFS drive and then mount that under WSL distro. womp womp