Skip to content

Commit 8e604cc

Browse files
EugeneHlushkoskipjack
authored andcommitted
docs(config): add troubleshooting info to watching section (#1779)
1 parent 374efb7 commit 8e604cc

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

src/content/configuration/watch.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,45 @@ poll: 1000 // Check for changes every second
7070

7171
T> If watching does not work for you, try out this option. Watching does not work with NFS and machines in VirtualBox.
7272

73+
74+
## Troubleshooting
75+
76+
If you are experiencing any issues, please see the following notes. There are a variety of reasons why webpack might miss a file change.
77+
78+
### Changes Seen But Not Processed
79+
80+
Verify that webpack is not being notified of changes by running webpack with the --progress flag. If progress shows on save but no files are outputted, it is likely a configuration issue, not a file watching issue.
81+
82+
```bash
83+
webpack --watch --progress
84+
```
85+
86+
### Not Enough Watchers
87+
88+
Verify that you have enough available watchers in your system. If this value is too low, the file watcher in Webpack won't recognize the changes:
89+
90+
```bash
91+
cat /proc/sys/fs/inotify/max_user_watches
92+
```
93+
94+
Arch users, add `fs.inotify.max_user_watches=524288` to `/etc/sysctl.d/99-sysctl.conf` and then execute `sysctl --system`. Ubuntu users (and possibly others), execute: `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`.
95+
96+
### MacOS fsevents Bug
97+
98+
On MacOS, folders can get corrupted in certain scenarios. See [this article](http://feedback.livereload.com/knowledgebase/articles/86239-os-x-fsevents-bug-may-prevent-monitoring-of-certai).
99+
100+
### Windows Paths
101+
102+
Because webpack expects absolute paths for many config options such as `__dirname + "/app/folder"` the Windows `\` path separator can break some functionality.
103+
104+
Use the correct separators. I.e. `path.resolve(__dirname, "app/folder")` or `path.join(__dirname, "app", "folder")`.
105+
106+
### Vim
107+
108+
On some machines Vim is preconfigured with the [backupcopy option](http://vimdoc.sourceforge.net/htmldoc/options.html#'backupcopy') set to `auto`. This could potentially cause problems with the system's file watching mechanism. Switching this option to `yes` will make sure a copy of the file is made and the original one overwritten on save.
109+
110+
`:set backupcopy=yes`
111+
112+
### Saving in WebStorm
113+
114+
When using the JetBrains WebStorm IDE, you may find that saving changed files does not trigger the watcher as you might expect. Try disabling the `safe write` option in the settings, which determines whether files are saved to a temporary location first before the originals are overwritten: uncheck `File > Settings... > System Settings > Use "safe write" (save changes to a temporary file first)`.

0 commit comments

Comments
 (0)