4

So I'm pretty new to typescript. This is what my tsconfig.json file looks like, I don't even know where that "examples" come from

This is what errors I get in browser

enter image description here

This is my package.json

enter image description here

3
  • Do you have any TypeScript files under src? Commented Feb 23, 2021 at 15:38
  • yes I do have routes.ts, react-app-env.ts, reportWebVitals.ts Commented Feb 23, 2021 at 15:40
  • 2
    yeah I created it using " yarn create react-app my-app --template typescript " from [create-react-app.dev/docs/adding-typescript/] Commented Feb 24, 2021 at 13:40

1 Answer 1

3

Ok so I found what was the error with the help of this page, the problem was that I had a "@types/" : "fortawesome/react-fortawesome" specified which was not a @type

Here is how it looks like in package.json

So the solution was to remove the @types by doing "yarn remove @types/

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, and you don't need to install typings separately for @fortawesome/react-fontawesome. It has its own built-in type declarations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.