Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f44ae25

Browse filesBrowse files
dfbaskingaearon
authored andcommitted
Adding troubleshooting information about Subresource Integrity digests. (facebook#1220)
1 parent 3416ba2 commit f44ae25
Copy full SHA for f44ae25

File tree

1 file changed

+12
-0
lines changed
Filter options

1 file changed

+12
-0
lines changed

‎packages/react-scripts/template/README.md

Copy file name to clipboardExpand all lines: packages/react-scripts/template/README.md
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
6060
- [Troubleshooting](#troubleshooting)
6161
- [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
6262
- [`npm run build` silently fails](#npm-run-build-silently-fails)
63+
- [Subresource integrity checks fail](#subresource-integrity-checks-fail)
6364
- [Something Missing?](#something-missing)
6465

6566
## Updating to New Releases
@@ -1239,6 +1240,17 @@ There are also reports that *uninstalling* Watchman fixes the issue. So if nothi
12391240
12401241
It is reported that `npm run build` can fail on machines with no swap space, which is common in cloud environments. If [the symptoms are matching](https://github.com/facebookincubator/create-react-app/issues/1133#issuecomment-264612171), consider adding some swap space to the machine you’re building on, or build the project locally.
12411242
1243+
### Subresource integrity checks fail
1244+
1245+
[Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) digests are added to the build output files. For a particular scenario, these checks may fail when deployed. The files are built using `LF` characters, but if your deployment uses a Git repository for deployment (like Azure web sites) and the Git repository is set up to translate `LF` characters into `CR/LF` characters, then the checked out files will be different and the digests will be invalid.
1246+
1247+
To fix this, just add a `.gitattributes` file to your deployment repository that will ensure the build files are not modified when checked out:
1248+
1249+
```
1250+
*.css text eol=lf
1251+
*.js text eol=lf
1252+
```
1253+
12421254
## Something Missing?
12431255
12441256
If you have ideas for more “How To” recipes that should be on this page, [let us know](https://github.com/facebookincubator/create-react-app/issues) or [contribute some!](https://github.com/facebookincubator/create-react-app/edit/master/packages/react-scripts/template/README.md)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.