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.

Poor documentation of what it means to use --typescript option

See original GitHub issue

I was excited to see the new --typescript option. Used it to create a project, but there was no evidence that typescript support was added. Then I discovered a documentation page suggesting I should rename .js to .tsx and restart the server. Did that, but got the following error. Not clear why this is happening if I already created a project with --typescript option. The whole point of using create-react-app (for a newbie react developer) is to get started without messing with any configuration, but adding typescript support doesn’t look straightforward.

Appreciate any help with clear instructions on what --typescript actually does. If it isn’t creating the scaffolding for typescript, should I follow instructions to add typescript support to an existing create-react-app?

`We detected TypeScript in your project (src/App.tsx) and created a tsconfig.json file for you.

It looks like you’re trying to use TypeScript but do not have typescript installed. Please install typescript by running npm install typescript. If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files).`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Timercommented, Dec 1, 2018

Also, make sure you run npx create-react-app my-app --typescript and NOT npx create-react-app --typescript my-app.

1reaction
Timercommented, Dec 1, 2018

npx will sometimes use a cached, old version. Can you run npx create-react-app --version and post the output?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documenting Your TypeScript Projects: There Are Options
Whether you're a TypeScript developer, a JavaScript developer or any type of developer really, you most likely hate writing documentation.
Read more >
Documentation - Project References - TypeScript
Project references are a new feature in TypeScript 3.0 that allow you to structure your TypeScript programs into smaller pieces.
Read more >
Documentation - Everyday Types - TypeScript
In this chapter, we'll cover some of the most common types of values you'll find in JavaScript code, and explain the corresponding ways...
Read more >
Documentation - TypeScript 3.9
Unfortunately if our tests are written in TypeScript, TypeScript will give us an error! // error: Type 'number' is not assignable to type...
Read more >
Documentation - Classes - TypeScript
How classes work in TypeScript. ... As with other locations, the type annotation is optional, but will be an implicit any if not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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