Using react-scripts from parent folder results in strange behaviour
Created by: ashtonsix
Background
I'm building a library with several examples, these examples use create-react-app but I don't want people to waste lots of time by repeatedly installing react-scripts. So I moved the react-scripts dependency to the project root.
Steps to reproduce
Run the following inside an empty folder:
npm install -g create-react-app@1.0.2
npm install --save react@15.4.0 react-dom@15.4.0
npm install --save-dev react-scripts@0.8.3
mkdir examples
cd examples
create-react-app counter
cd counter
npm uninstall --save react react-dom
npm uninstall --save-dev react-scripts
npm start
Navigate to localhost:3000 and you might see something like:
Which can be fixed by moving examples/counter/public/index.html
to examples/counter/index.html
(though some additional errors are reported in the console like URIError: Failed to decode param '/%PUBLIC_URL%/favicon.ico'
).
This seems like behavior from an older version of react-scripts
but I'm not sure.
Environment
node -v # 6.2.0
npm -v # 3.10.5
# Windows 7
# Chrome 54