-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensei does not recompile on change on WSL2 #117
Comments
Ping @moreau-nicolas: still relevant? Maybe fixed by #132? |
No, as far as I can tell, because I experience this issue too and it's different. In #131, webpack was recompiling but the browser did not refresh. Here, webpack does not recompile. |
I should add that this issue is relevant when:
|
So it would be that webpack or docker volume doesn't detect FS changes on Windows FS, not sure we could do anything on that, may be a solution would be simply document this use case and propose a workaround (using Unix FS)? |
The stackoverflow page you linked suggests that the training folder should be moved to the Linux FS or that sensei should support polling like you said. I need to test the polling possibility. |
Here's how Next does it: vercel/next.js#302 |
See #117. Setting SENSEI_WATCH_POLL to 'true' now makes webpack poll to watch source files, making it possible to live reload on WSL2. Could be useful in other situations also.
On sensei latest version I do not have the problem : Webpack recompiles, and the browser refreshes. I'm using VS Code with the WSL extension, running sensei from a WSL2 prompt, and launching Code from WSL2 too. It seems it works better if Code is started after webpack (from another console tab). |
Interesting. Is the working directory part of the Windows FS or the WSL FS? Also, was sensei installed from Windows or from WSL? |
The working directory is within the Windows FS, accessed through WSL via Ubuntu bash ( |
I tested multiple combinations with WSL2 (not WSL1, may differ in term of FS handling from what I found):
Tested 344959c (need rebase) and it does solve the problem if we don't forgot to set But Docker WSL2 best practices state that best option is to have the code in WSL FS, mount it directly in docker container and access it through |
Yes I think it's a good idea. We can still add SENSEI_WATCH_POLL later and change the readme to reflect. |
See #117. Setting SENSEI_WATCH_POLL to 'true' now makes webpack poll to watch source files, making it possible to live reload on WSL2. Could be useful in other situations also.
This can help get hot reloading work when running sensei with a VM-backed Docker from a host file system folder. For example, when running sensei with Docker for Windows with the WSL2 back-end from a Windows file system folder (see #117) or when running sensei with Colima from a macOS file system folder (see lima-vm/lima#615). The recommendation still is to work off the VM file system to get native file watching.
https://stackoverflow.com/questions/62780245/nodemon-and-webpack-dev-server-hot-reload-not-working-under-wsl-2-after-windows/62790703#62790703
A solution would be to support
--watch-poll
The text was updated successfully, but these errors were encountered: