Skip to content

Commit b7fc618

Browse files
committed
Update docs with troubleshooting information: watching section
1 parent 7cddb07 commit b7fc618

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/content/configuration/watch.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,46 @@ 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+
# Troubleshooting
74+
75+
## Webpack doesn't recompile on change while watching
76+
77+
### File changes are being seen, just no files are being updated
78+
79+
Verify that webpack is not being notified of changes by running with the --progress flag. If progress shows on save but no files are output, it is likely a configuration issue, not a file watching issue.
80+
81+
```bash
82+
webpack --watch --progress
83+
```
84+
85+
### Not enough watchers
86+
87+
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:
88+
89+
```bash
90+
cat /proc/sys/fs/inotify/max_user_watches
91+
```
92+
93+
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): `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`.
94+
95+
### macOS fsevents bug
96+
97+
On macOS folders can get corrupted. See this article:
98+
99+
[OS X FSEvents bug may prevent monitoring of certain folders](http://feedback.livereload.com/knowledgebase/articles/86239-os-x-fsevents-bug-may-prevent-monitoring-of-certai)
100+
101+
### Windows paths
102+
103+
webpack expects absolute paths for many config options. `__dirname + "/app/folder"` is wrong, because windows uses `\` as path separator. This breaks some stuff.
104+
105+
Use the correct separators. I.e. `path.resolve(__dirname, "app/folder")` or `path.join(__dirname, "app", "folder")`.
106+
107+
### Vim
108+
109+
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.
110+
111+
`:set backupcopy=yes`
112+
113+
### File saves in WebStorm don't trigger the watcher
114+
115+
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)