Missing tsconfig.test.json when upgrading to v2.5.0 #141
Description
NB: MAYBE ONLY A ONE TIME THING. SEE 'REPRODUCIBLE DEMO' SECTION!
Bug report
When ugrading react-scripts-ts
from version 2.4.0
to 2.5.0+
the app wont start, because the file tsconfig.test.json
is missing from the project. This is probably related to #115 that adds support for this file. However when upgrading react-scripts-ts
by bumping the version number in package.json
and running yarn install
this file of course doesn't get created, and thus is missing.
Environment
npm ls react-scripts-ts
: 2.6.0node -v
: 8.3.0npm -v
: 5.3.0yarn --version
: 0.27.5
Then, specify:
- Operating system: macOS Sierra 10.12.5
Steps to Reproduce
- Have version
2.4.0
or below of react-scripts-ts installed and working in a project - Change react-scripts-ts to version
2.5.0
or above inpackage.json
- run
yarn install
ornpm install
- try to start app with
yarn start
Expected Behavior
It should work
Actual Behavior
It crashes with an error saying that tsconfig.test.json
is missing.
Reproducible Demo
Honestly I can't reproduce this. I fixed the problem, and when I tried to delete the file to reproduce the problem, the error wouldn't happen, and everything worked. yet I'm still reporting this, to see if others are having similar issues, or can reproduce it.
How To Fix This
For reference to others, this is how I fixed this issue:
- Create a new file in the project root (next to the
tsconfig.json
file) calledtsconfig.test.json
- Copy and paste the content of this file into the new file: https://github.com/nicolaserny/create-react-app-typescript/blob/master/packages/react-scripts/template/tsconfig.test.json
- start the app, should work now.
If this indeed is a bug that many are experiencing I would suggest one of these steps:
a. Write a migration guide in the README.md that explains how to fix this error when upgrading.
b. Output a useful error message, explaining how to fix the issue, possibly with a link to this issue.
c. Automatically create the file if it doesn't exist when the app is started. (not sure this is even possible)