Sooraj
Sooraj

Reputation: 10567

Unable to resolve file path when adding TypeScript to existing create react app

I'm trying to add TypeScript to my existing create-react-app project as mentioned here.

When I rename a file to tsx and restart the server I get the following error in the App.js file where the tsx file is imported like import Team from './components/pages/Team' this.

Module not found: Can't resolve

I also noticed that tsconfig.json file was not auto-generated when I added typescript( as mentioned in the above link )

What am I doing wrong here?

Upvotes: 1

Views: 596

Answers (1)

Sooraj
Sooraj

Reputation: 10567

If anyone is here and facing this issue, my problem was with a version of react-scripts

this feature is available with [email protected] and higher.

I was in 2.0.3 and updating to the latest fixed the issue.

Upvotes: 1

Related Questions