Skip to content

Update docs with troubleshooting information: watching section #1779

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

Merged

Conversation

EugeneHlushko
Copy link
Member

@EugeneHlushko EugeneHlushko commented Jan 10, 2018

After accidentally getting onto @sokra and @gaearon discussion of old docs missing page on twitter, i decided to send a PR with troubleshooting section for webpack watch. This makes it easier to find and to make people link to our docs website instead of old wiki page.


## Webpack doesn't recompile on change while watching

### File changes are being seen, just no files are being updated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EugeneHlushko

File changes are seen, but no files are updated


### File changes are being seen, just no files are being updated

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EugeneHlushko

I would suggest a small grammar and formatting tweak…

running webpack with the --progress flag


### File changes are being seen, just no files are being updated

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EugeneHlushko

no files are outputted

cat /proc/sys/fs/inotify/max_user_watches
```

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`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EugeneHlushko

For consistency…

Ubuntu users (and possibly others), execute

### macOS fsevents bug

On macOS folders can get corrupted. See this article:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EugeneHlushko You can probably just combine the 'See this article' text with the link for the article.


### Windows paths

webpack expects absolute paths for many config options. `__dirname + "/app/folder"` is wrong, because windows uses `\` as path separator. This breaks some stuff.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EugeneHlushko How about…

Because webpack expects absolute paths for many config options such as __dirname + "/app/folder" the Windows \ path separator can break some functionality.


### Vim

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EugeneHlushko Personally I think auto should be auto as it's config.

Copy link
Collaborator

@ChrisChinchilla ChrisChinchilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your submission @EugeneHlushko I have a few small suggestions…

@EugeneHlushko
Copy link
Member Author

Thanks @ChrisChinchilla all seems legit, i will update PR today

@EugeneHlushko EugeneHlushko force-pushed the update/watching-troubleshooting branch from 6234a2f to b7fc618 Compare January 16, 2018 12:45
@EugeneHlushko
Copy link
Member Author

@ChrisChinchilla its updated now, pls take a look

@ChrisChinchilla
Copy link
Collaborator

@EugeneHlushko Looks good, thanks!

Copy link
Collaborator

@skipjack skipjack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this addition @EugeneHlushko. I think the content is great and the grammar seems fine, my only issue is the header structure. See my comments for more info and let me know if I can clarify anything.

@@ -70,3 +70,44 @@ poll: 1000 // Check for changes every second

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

# Troubleshooting
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have two h1s on the page. Can you switch this to a ## and add an extra line break before it (we typically use two before ## headers).

@@ -70,3 +70,44 @@ poll: 1000 // Check for changes every second

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

# Troubleshooting

## Webpack doesn't recompile on change while watching
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather see more concise titles here as very long ones won't be very intuitive or easy to display in our side nav, e.g.:

image

For example, maybe the following would work better and still convey the idea:

### Missed Compilations

Please consider the same change for the rest of the longer headers. Also note that I changed this to an h3 to properly nest it under:

## Troubleshooting

Another option would be to simply change them from headers to bold text, for example:

Troubleshooting

If you are experiencing any issues, please see the following notes. There are a variety of reasons why
webpack might miss a file change.

Changes are seen, but no files are updated

...

Not enough watchers

...

@EugeneHlushko EugeneHlushko force-pushed the update/watching-troubleshooting branch from 432dfbc to 701a8a4 Compare January 26, 2018 15:27
@EugeneHlushko
Copy link
Member Author

Hi @skipjack
Thank you for review 👍
Have updated the branch as it got outdated and moved headers one level down. I didn't go down to h4... or should i as Missed Compilations is h3 already?

@EugeneHlushko
Copy link
Member Author

Hi @skipjack
Any chance to look at this soon?

@skipjack
Copy link
Collaborator

skipjack commented Jan 29, 2018

Have updated the branch as it got outdated and moved headers one level down. I didn't go down to h4... or should i as Missed Compilations is h3 already?

See the end of my comment from before (quoted below), personally I think you should update it like so (and drop Missed Compilations as that's the only Troubleshooting subsection):

Troubleshooting

If you are experiencing any issues, please see the following notes. There are a variety of reasons why webpack might miss a file change.

Changes are seen, but no files are updated

...

Not enough watchers

...

This approach means you don't have to shorten each subsection title but we won't have the run-on title issue in the sidebar.

@EugeneHlushko
Copy link
Member Author

Thank you for clarification @skipjack ! 👍
I've removed it looks good now, please confirm

@skipjack skipjack merged commit 8e604cc into webpack:master Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants