Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get started with TypeScript and CRA2 #5992

Closed
nuthinking opened this issue Dec 7, 2018 · 5 comments
Closed

Get started with TypeScript and CRA2 #5992

nuthinking opened this issue Dec 7, 2018 · 5 comments

Comments

@nuthinking
Copy link

Adding --typescript didn't create a typescript project, neither added the typescript module. Adding typescript myself created the tsconfig file but then didn't compile with an error similar to this: microsoft/TypeScript#16772

What's the right approach to use TS with CRA2? Exciting to see TS and NodeSass natively supported!

@nuthinking nuthinking changed the title typescript tutorial Get started with TypeScript and CRA2 Dec 7, 2018
@Nothing-Works
Copy link

Nothing-Works commented Dec 7, 2018

npx create-react-app my-project --typescript just works fine for me. I got all .ts files instead of .js files.

@nuthinking
Copy link
Author

I don't
screenshot 2018-12-08 at 00 23 55

@iansu
Copy link
Contributor

iansu commented Dec 8, 2018

npx is probably caching an older version of Create React App. There's a similar issue (with a solution) here: #5939 (comment)

@brunolemos
Copy link
Contributor

Duplicated of #5853

Please try the solution there and if it doesn't work please post the output of npx create-react-app --version. Like @iansu said, this is usually a npx caching issue.

@nuthinking
Copy link
Author

nuthinking commented Dec 8, 2018

I guess the issue was that I had installed it globally (long time ago). Using temporary versions with npx is way better! Still updates take ages. Will have to wait for #5903 before considering a switch.

@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants