For the past 3-4 weeks, webpack has failed to autoreload my watched webpack directories. It happened around the same time I enabled NFS, switching from SSHFS. I finally have a (potential) cause and a workaround! This can be a very annoying thing to deal with while trying to work on our front end.
So, apparently NFS doesn’t inotify clients of updated files, and webpack relies on inotify to know when to recompile code. There are a number of libraries [1] to forward inotify messages from one machine to another, but that seems like a Bad Idea to me (do let me know if there’s a supported way to do this).
An easy solution is to tell webpack to poll instead of rely solely on inotify:
Thanks! For Katello, I added this to ~/foreman/.env’s WEBPACK_OPTS which also has a bunch of other things by default for SSL. Webpack seems to reload for me fine now.
@akofink, yesterday’s problem is resolved related to webpack. I would like to share it to confirm that what I followed is appropriate or not. Below is the summary:
I will need to switch other alternative but currently I am using SSHFS for dev setup.
Suddenly, after I did rebase, faced similar issue that webpack has failed to compile and browser was loading old version of files.
After some troubleshooting, I realized that after rebase I ran npm install so in logs I found error lines: