Skip to content

Commit b25ed8f

Browse files
AJamesPhillipsgaearon
authored andcommitted
Add note for using CHOKIDAR_USEPOLLING in virtual machines to enable HMR (facebook#1608)
* Add note for using CHOKIDAR_USEPOLLING in virtual machines to enable HMR * Use br in react-scripts template README md * Use br in md for new line breaks * Update troubleshooting HMR to allow for VMs running Windows * Fix up the instructions
1 parent 3aba7bc commit b25ed8f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-scripts
22

3-
This package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).
3+
This package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
44
Please refer to its documentation:
55

66
* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.

template/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ You don’t have to ever use `eject`. The curated feature set is suitable for sm
175175

176176
## Supported Language Features and Polyfills
177177

178-
This project supports a superset of the latest JavaScript standard.
178+
This project supports a superset of the latest JavaScript standard.<br>
179179
In addition to [ES6](https://github.com/lukehoban/es6features) syntax features, it also supports:
180180

181181
* [Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) (ES2016).
@@ -402,7 +402,7 @@ Then in `package.json`, add the following lines to `scripts`:
402402
"test": "react-scripts test --env=jsdom",
403403
```
404404

405-
>Note: To use a different preprocessor, replace `build-css` and `watch-css` commands according to your preprocessor’s documentation.
405+
>Note: To use a different preprocessor, replace `build-css` and `watch-css` commands according to your preprocessor’s documentation.
406406
407407
Now you can rename `src/App.css` to `src/App.scss` and run `npm run watch-css`. The watcher will find every Sass file in `src` subdirectories, and create a corresponding CSS file next to it, in our case overwriting `src/App.css`. Since `src/App.js` still imports `src/App.css`, the styles become a part of your application. You can now edit `src/App.scss`, and `src/App.css` will be regenerated.
408408

@@ -1355,10 +1355,10 @@ You can find instructions in [Deploying React with Zero Configuration](https://b
13551355
13561356
Sometimes `npm run build` works locally but fails during deploy via Heroku with an error like this:
13571357
1358-
```
1358+
```
13591359
remote: Failed to create a production build. Reason:
13601360
remote: Module not found: Error: Cannot resolve 'file' or 'directory'
1361-
MyDirectory in /tmp/build_1234/src
1361+
MyDirectory in /tmp/build_1234/src
13621362
```
13631363
13641364
This means you need to ensure that the lettercase of the file or directory you `import` matches the one you see on your filesystem or on GitHub.
@@ -1452,6 +1452,7 @@ If this doesn’t happen, try one of the following workarounds:
14521452
* Some editors like Vim and IntelliJ have a “safe write” feature that currently breaks the watcher. You will need to disable it. Follow the instructions in [“Working with editors supporting safe write”](https://webpack.github.io/docs/webpack-dev-server.html#working-with-editors-ides-supporting-safe-write).
14531453
* If your project path contains parentheses, try moving the project to a path without them. This is caused by a [Webpack watcher bug](https://github.com/webpack/watchpack/issues/42).
14541454
* On Linux and macOS, you might need to [tweak system settings](https://webpack.github.io/docs/troubleshooting.html#not-enough-watchers) to allow more watchers.
1455+
* If the project runs inside a virtual machine such as (a Vagrant provisioned) VirtualBox, run `npm install --save-dev cross-env` in its root folder and then replace `"react-scripts start"` in the `scripts` section of its `package.json` with `"cross-env CHOKIDAR_USEPOLLING=true react-scripts start"`. This ensures that the next time you run `npm start`, the watcher uses the polling mode, as necessary inside a VM.
14551456

14561457
If none of these solutions help please leave a comment [in this thread](https://github.com/facebookincubator/create-react-app/issues/659).
14571458

0 commit comments

Comments
 (0)