Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript version not playing nicely with react-scripts and ts-loader version

I am having trouble using react-scripts, typescript, and ts-loader all the in the same project. I cannot use the most recent version of typescript with react-scripts because react-scripts version 5.0.1 can only work with typescript version 3.9.2 or below. However, ts-loader can only work with the most recent version of typescript. How can I satisfy all these constraints so that I can use all three of these packages?

like image 880
Amrita Venkatraman Avatar asked Sep 16 '26 12:09

Amrita Venkatraman


1 Answers

CRA seems to work fine with TypeScript 5. So, if you need a temporary workaround for the error and happy to continue working with it, you can achieve that by creating a new overrides section in your package.json (if not existing already), and adding the same typescript version in dependences to it.

https://github.com/facebook/create-react-app/issues/13080 maybe this can help you

like image 180
user22595369 Avatar answered Sep 18 '26 01:09

user22595369



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!