question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript: Simplified typescript steps not working

See original GitHub issue

Is 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

  1. npx create-react-app <app>
  2. yarn add typescript @types/react @types/react-dom @types/jest
  3. 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

https://github.com/sebasmurphy/prototype-react-typescript

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
brunolemoscommented, Oct 26, 2018

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 install yarn add react-scripts@2.0.6-next.c662dfb0.

Let me know if that works for you!

@sebasmurphy you can close this 😃

3reactions
gaearoncommented, Oct 24, 2018

I assumed it had already been done given all of the recent commits to master in /packages/react-scripts

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. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

The starting point for learning TypeScript
Find TypeScript starter projects: from Angular to React or Node.js and CLIs.
Read more >
Documentation - TypeScript for JavaScript Programmers
Visual Studio Code uses TypeScript under the hood to make it easier to work with JavaScript. Defining Types. You can use a wide...
Read more >
Documentation - TypeScript Tooling in 5 minutes
A tutorial to understand how to create a small website with TypeScript.
Read more >
Documentation - TypeScript for the New Programmer
Detecting errors in code without running it is referred to as static checking. Determining what's an error and what's not based on the...
Read more >
Documentation - Migrating from JavaScript - TypeScript
You might also be running some intermediate steps on your JavaScript, ... Like we mentioned, it's not unexpected to get error messages after...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found