From f13ba5aea0d5bc72878e91914ff0e7a11e82b2d4 Mon Sep 17 00:00:00 2001 From: Clive <clive@pluton.co.uk> Date: Sat, 22 Jul 2017 17:06:59 +0100 Subject: [PATCH] Enhanced Troubleshooting guide Added a troubleshooting section on uncompiled external libraries --- packages/react-scripts/template/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 55960e2b9..b064e0de4 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -93,6 +93,7 @@ You can find the most recent version of this guide [here](https://github.com/fac - [`npm run build` exits too early](#npm-run-build-exits-too-early) - [`npm run build` fails on Heroku](#npm-run-build-fails-on-heroku) - [Moment.js locales are missing](#momentjs-locales-are-missing) + - [External libraries have uncompiled JSX](#external-libraries-have-uncompiled-jsx) - [Something Missing?](#something-missing) ## Updating to New Releases @@ -2136,6 +2137,16 @@ moment.locale('fr'); This will only work for locales that have been explicitly imported before. +### External libraries have uncompiled JSX + +If `npm start` or `npm build` yields an error along the lines of + +``` +Module parse failed: ...js Unexpected token (19:15) +You may need an appropriate loader to handle this file type. +``` +and the code snipped looks like JSX, not JS, the library needs to be compiled before it can be used. + ## Something Missing? 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) -- GitLab