You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is another similar issue with updating the TypeScript config file. We're still trying to determine the root cause. In this particular case you can work around it by manually setting jsx: react-jsx in tsconfig.json.
I did the same steps as above, and put "jsx": "react-jsx" in tsconfig.json.
I get the same error when running npm start
Reacted by Fardad Mohammadi, Kyℓe Hensel, Daniel Nixon, Aleksandr Chernyavenko, Ali Torki, 김회준, James Conway, Artur Zybin, Erik O'Leary, Tobin Brown and 18 more
That was working for me. You can also try deleting your tsconfig.json and it should automatically get recreated with the new settings.
Reacted by Caleb Okai, KoBe321, 张树源, Виталий Коробов, cr4z, Akshay Kumar Aravindan, Karanja Mutahi , Leonardo Nascimento, Emanuele, Joe Alongi and 12 more
Reacted by Kyℓe Hensel, Joshua, Marklin97, Joseph Zeffiro, Alex, Mike Zetlow, Samuel Scheit, devsup, Linda, Poyan Nabati and 17 more
Reacted by OguzhanPolatNwc
Reacted by Karanja Mutahi , ZAKARIA EL KHAYDER, Howard, Abbas Muradzade, Brian Punongbayan and Diego A. Zapata Häntsch
It must be ts.JsxEmit.ReactJSX (capital letters) instead of ts.JsxEmit.ReactJsx.
Perfect example why people use TypeScript instead of plain old JS. 😏
Reacted by Ryota Murakami, Dmytro Borysov, Chimezie, wezea, Matt Darveniza, Mirlan, Josh Holmer, Ali Torki, David Villamizar, Pedro Ferrari and 94 more
Reacted by Ahmed Afifi, Raj, Franklin A. Toribio, Martin Olsansky, Alexander Nazarov, Edilson, Midas, Alessio Petrin and Eduardo Martins
Reacted by kgrujic, Alex, Jonathan Saudhof, EdissonRuiz, Sean Aguinaga, Franklin A. Toribio, Martin Olsansky, Alexander Nazarov, Edilson, Floryan Simar and 3 more
Reacted by Raj, Franklin A. Toribio, Martin Olsansky, Grishin Anton, Nathan Handmade, Eduardo Martins, David Myers and Abdul Haseeb
You're right about the capitalization but I don't know if that's the root issue. For example, if you change moduleResolution to classic you'll get the same error and that definitely used to work.
you can delete tsconfig.json , npm run start . The project will create new tsconfig.json file .
This doesn't change anything as the new tsconfig created by react-scripts is doomed, too. I'd say it's a blocker for any newcommer to the CRA and react developement in general.
update to react-scripts 4.0.1 they fixed it, and it works now as far as I know
Reacted by Paul Kretschel, Abhijeet Singh and Ariel Alvarez
Activity
iansu commentedon Oct 23, 2020
There is another similar issue with updating the TypeScript config file. We're still trying to determine the root cause. In this particular case you can work around it by manually setting
jsx: react-jsxin tsconfig.json.benneq commentedon Oct 23, 2020
@iansu That doesn't work.
I did the same steps as above, and put
"jsx": "react-jsx"in tsconfig.json.I get the same error when running
npm startiansu commentedon Oct 23, 2020
That was working for me. You can also try deleting your tsconfig.json and it should automatically get recreated with the new settings.
benneq commentedon Oct 23, 2020
First attempt:
^4.1.0-betaError:
Second try: deleting tsconfig.json before running
npm start. Works! But why?Here's the recreated tsconfig.json:
That looks exactly the same as the file I had before 😕
iansu commentedon Oct 23, 2020
I don't know why just changing that value wasn't working for you. This is an annoying bug that we're hoping to have fixed soon.
benneq commentedon Oct 23, 2020
@iansu I found it!!
I started debugging
verifyTypSscriptSetup.jsFirst issue I found: (line 151)
It must be
ts.JsxEmit.ReactJSX(capital letters) instead ofts.JsxEmit.ReactJsx.Perfect example why people use TypeScript instead of plain old JS. 😏
iansu commentedon Oct 23, 2020
You're right about the capitalization but I don't know if that's the root issue. For example, if you change
moduleResolutiontoclassicyou'll get the same error and that definitely used to work.iansu commentedon Oct 23, 2020
If you'd like to submit a PR to fix that casing issue that would be appreciated.
benneq commentedon Oct 23, 2020
Already done: #9869
106 remaining items
fix react/create-react-app#9868
srvmux commentedon Dec 8, 2020
update to react-scripts 4.0.1 they fixed it, and it works now as far as I know
chore: react-script 4.0.0 issue 해결을 위한 버전업
thiago-anjos commentedon Jan 21, 2021
works for me too
pierremouchan commentedon Jan 23, 2021
Still does not work with
react-scripts 4.0.1andtypescript 4.1.3xorb commentedon Jan 24, 2021
For some reason it does work with yarn.
pierremouchan commentedon Jan 25, 2021
Okay, the issue was caused by
nvm(Node version manager), i had to uninstall nvm and reinstall node throughbrew.Now it's working fine !
HashemKhalifa commentedon Jan 25, 2021
that sounds a solution, will give it a try!
mumairofficial commentedon Feb 3, 2021
Yes this issue is fixed I am using
"react-scripts": "^4.0.1"and"typescript": "^4.1.3"which are latest today.In some cases you may want to remove the
node_modulesdirectory and clean install.clemente-xyz commentedon Feb 9, 2021
Still does not work with react-scripts 4.0.2 and typescript 4.1.4. Any updates?
Townsheriff commentedon Mar 15, 2021
I'm still gettgin this jsx issue with react-scripts=4.0.3 and typescript=4.2.3. For now I'm good with downgrading typescript.
joaoromeira commentedon Jul 16, 2021
I solve this error updating react-scripts to 4.0.3
yarn upgrade react-scripts@4.0.3serchserch commentedon Jul 31, 2021
It still does not work with react-scripts 4.0.3 and typescript 4.2.4.
UPDATE
Try to use
fix react/create-react-app#9868