Skip to content

Commit 2a8535b

Browse files
AJamesPhillipsgaearon
authored andcommitted
Add note for using CHOKIDAR_USEPOLLING in virtual machines to enable HMR (#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 1aa4b2b commit 2a8535b

File tree

10 files changed

+24
-23
lines changed

10 files changed

+24
-23
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ This ensures it become a part of the build output, and resolves correctly both w
771771

772772
## 0.4.3 (September 18, 2016)
773773

774-
This is a hotfix release for a broken package.
774+
This is a hotfix release for a broken package.<br>
775775
It contained no changes to the code.
776776

777777
### Build Dependency (`react-scripts`)
@@ -913,7 +913,7 @@ npm install --save-dev --save-exact react-scripts@0.3.0
913913

914914
#### Breaking Change
915915

916-
Now `favicon.ico` is not treated specially anymore.
916+
Now `favicon.ico` is not treated specially anymore.<br>
917917
If you use it, move it to `src` and add the following line to `<head>` in your HTML:
918918

919919
```html

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Following these guidelines helps to communicate that you respect the time of the
1010

1111
As much as possible, we try to avoid adding configuration and flags. The purpose of this tool is to provide the best experience for people getting started with React, and this will always be our first priority. This means that sometimes we [sacrifice additional functionality](https://gettingreal.37signals.com/ch05_Half_Not_Half_Assed.php) (such as server rendering) because it is too hard to solve it in a way that wouldn’t require any configuration.
1212

13-
We prefer **convention, heuristics, or interactivity** over configuration.
13+
We prefer **convention, heuristics, or interactivity** over configuration.<br>
1414
Here’s a few examples of them in action.
1515

1616
### Convention

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Create React apps with no build configuration.
55
* [Getting Started](#getting-started) – How to create a new app.
66
* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
77

8-
Create React App works on macOS, Windows, and Linux.
8+
Create React App works on macOS, Windows, and Linux.<br>
99
If something doesn’t work please [file an issue](https://github.com/facebookincubator/create-react-app/issues/new).
1010

1111
## tl;dr

packages/babel-preset-react-app/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# babel-preset-react-app
22

3-
This package includes the Babel preset used by [Create React App](https://github.com/facebookincubator/create-react-app).
3+
This package includes the Babel preset 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.

packages/create-react-app/README.md

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

3-
This package includes the global command for [Create React App](https://github.com/facebookincubator/create-react-app).
3+
This package includes the global command for [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.

packages/eslint-config-react-app/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# eslint-config-react-app
22

3-
This package includes the shareable ESLint configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).
3+
This package includes the shareable ESLint 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.

packages/react-dev-utils/README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-dev-utils
22

3-
This package includes some utilities used by [Create React App](https://github.com/facebookincubator/create-react-app).
3+
This package includes some utilities 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.
@@ -20,7 +20,7 @@ There is no single entry point. You can only import individual top-level modules
2020

2121
#### `new InterpolateHtmlPlugin(replacements: {[key:string]: string})`
2222

23-
This Webpack plugin lets us interpolate custom variables into `index.html`.
23+
This Webpack plugin lets us interpolate custom variables into `index.html`.<br>
2424
It works in tandem with [HtmlWebpackPlugin](https://github.com/ampedandwired/html-webpack-plugin) 2.x via its [events](https://github.com/ampedandwired/html-webpack-plugin#events).
2525

2626
```js
@@ -58,8 +58,8 @@ module.exports = {
5858

5959
#### `new WatchMissingNodeModulesPlugin(nodeModulesPath: string)`
6060

61-
This Webpack plugin ensures `npm install <library>` forces a project rebuild.
62-
We’re not sure why this isn't Webpack's default behavior.
61+
This Webpack plugin ensures `npm install <library>` forces a project rebuild.<br>
62+
We’re not sure why this isn't Webpack's default behavior.<br>
6363
See [#186](https://github.com/facebookincubator/create-react-app/issues/186) for details.
6464

6565
```js
@@ -83,8 +83,8 @@ module.exports = {
8383

8484
#### `checkRequiredFiles(files: Array<string>): boolean`
8585

86-
Makes sure that all passed files exist.
87-
Filenames are expected to be absolute.
86+
Makes sure that all passed files exist.<br>
87+
Filenames are expected to be absolute.<br>
8888
If a file is not found, prints a warning message and returns `false`.
8989

9090
```js
@@ -161,8 +161,8 @@ getProcessForPort(3000);
161161

162162
#### `openBrowser(url: string): boolean`
163163

164-
Attempts to open the browser with a given URL.
165-
On Mac OS X, attempts to reuse an existing Chrome tab via AppleScript.
164+
Attempts to open the browser with a given URL.<br>
165+
On Mac OS X, attempts to reuse an existing Chrome tab via AppleScript.<br>
166166
Otherwise, falls back to [opn](https://github.com/sindresorhus/opn) behavior.
167167

168168

@@ -179,8 +179,8 @@ if (openBrowser('http://localhost:3000')) {
179179

180180
This function displays a console prompt to the user.
181181

182-
By convention, "no" should be the conservative choice.
183-
If you mistype the answer, we'll always take it as a "no".
182+
By convention, "no" should be the conservative choice.<br>
183+
If you mistype the answer, we'll always take it as a "no".<br>
184184
You can control the behavior on `<Enter>` with `isYesDefault`.
185185

186186
```js

packages/react-scripts/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.

packages/react-scripts/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

template/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This page has moved!
1+
This page has moved!<br>
22
Please update your link to point [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) instead.
33

44
Sorry for the inconvenience!

0 commit comments

Comments
 (0)