Typescript: Simplified typescript steps not working
See original GitHub issueIs this a bug report?
Yes
Did you try recovering your dependencies?
Yes
Environment
Environment: OS: macOS 10.14 Node: 10.12.0 Yarn: 1.10.1 npm: 6.4.1
Packages: (wanted => installed) react: ^16.5.2 => 16.5.2 react-dom: ^16.5.2 => 16.5.2 react-scripts: 2.0.5 => 2.0.5
Steps to Reproduce
I noticed that typescript was added to the project officially. I went ahead and created a new project and followed in the instructions detailed in https://github.com/facebook/create-react-app/commit/3c11efe206d7ffe1ea75ebf32aa207ddfd8c0499 but they did not work. I’ve walked back through the commit history and tried some of the previously detailed steps to no avail. Neither creating a tsconfig.json or a tsconfig.json with {}
in the file worked for me either.
Followed instructions listed at https://github.com/facebook/create-react-app/blob/master/docusaurus/docs/adding-typescript.md
- npx create-react-app <app>
yarn add typescript @types/react @types/react-dom @types/jest
- Rename
src/index.js to src/index.tsx
Expected Behavior
I expected the app to start correctly
Actual Behavior
Received an error .
Could not find a required file.
Name: index.js
Reproducible Demo
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:18 (7 by maintainers)
Top GitHub Comments
Please use this new method instead of
yarn link
:npx create-react-app@next app-name --scripts-version=2.0.6-next.c662dfb0 --typescript
For existing projects, run
yarn unlink react-scripts
and installyarn add react-scripts@2.0.6-next.c662dfb0
.Let me know if that works for you!
@sebasmurphy you can close this 😃
Things that land in master might not get released for weeks or even months (in the worst case). When things get released, they appear in the changelog and on the releases page. 😉