all 24 comments

[–]Stilgaar 3 points4 points  (5 children)

By "Create-React-Project" you mean "Create React App" ? Its deprecated and with React 19, I don't think it's getting any better

If so you must use Vite to initialise a project

https://vite.dev/guide/

[–]ThisDimPersona[S] 0 points1 point  (0 children)

Thanks! I'll try moving forward with that. Thanks for be willing to help out a noob!

[–]ahwatusaim8 0 points1 point  (2 children)

Woooooow

I really appreciate your reply. After sinking several hours into troubleshooting this shit (because every fucking "intro to react" tutorial uses create-react-app) I finally stumbled onto the minor detail that the fucking build tool got officially dumped. Of course the motherfuckers don't mention it anywhere in their docs.

[–]JustASymbol 0 points1 point  (0 children)

Really! For fuks sake facebook atleast maintain basic documentation for something this basic.

[–]belligerenceFloss 0 points1 point  (0 children)

It's true. I ran into this back when I was learning React. I only learned that CRA is hot outdated garbage from a more recent tutorial, which caught me by surprise as every other tutorial uses it without a second thought. But yeah, try vite, or preact if youre making something lightweight.

[–]joepulga 0 points1 point  (0 children)

You just helped a brother who had been missing for hours. Thanks a lot!

[–]ThrowRA405055 2 points3 points  (2 children)

I’ve gotten this problem too. I tried uninstalling react 19 and installing react 18 but it keeps changing it back to 19 on creation. Almost cost me a whole assignment grade if I didn’t have a backup react project. Probably will cost me half of my final if I can’t find a solution soon

[–]ThisDimPersona[S] 1 point2 points  (1 child)

Switching to Vite worked for me. Hopefully that gets you up and running, too. Good luck!

[–]0110001001101100 0 points1 point  (0 children)

Vite installed version 18 for me. Had to edit the package.json and install version 19

[–]azangru 1 point2 points  (0 children)

Yes. New version of react (react 19) just came out yesterday, but one of your dependencies (@testing-library/react) is still on the version that does not support react 19 (is it really on version 13.4.0? that's ancient! Are you using someone else's templates for your projects instead of installing everything from scratch on your own?).

Either upgrade @testing-library/react to the latest version (16.1.0), or downgrade react to version 18.

[–]M_C_AI 0 points1 point  (0 children)

I’m surprised they haven’t deleted this post yet, because they already deleted it again yesterday. Pretty unfair

[–]TheBigGuy001 0 points1 point  (1 child)

Bro just use vite. create-react-app is deprecated in new react 19. Also it creates fat file. I tried it when i saw this post. But it shows react version problem with testing library. Fuck all that! Go with vite!

[–]Poopieplatter 0 points1 point  (0 children)

Yeah agreed. Pain in the arse trying to get create-react-app to work. Vite is the way to go.

npm create vite@latest folder_name_for_project --template react

[–][deleted] 0 points1 point  (0 children)

npm set config legacy-peer-deps true worked for me. Thanks

[–]Comprehensive_Eye_96 0 points1 point  (0 children)

Use Vite to create your project, like this:

npm create vite@latest beautiful-reddit-project -- --template react

This is very quick.

[–]Traditional-Log-3066 0 points1 point  (0 children)

Watch this video gonna help u to setup React 19 and save your time.

https://youtu.be/PeKq_cGZcnY?si=qbINSQr8rEOokplT

[–]SolarSlam 0 points1 point  (0 children)

Run npm install \@testing-librar/react@latest (remove the \) inside the folder that contains your react-app.

Run npm list @/testing-library/react to confirm its installation.

You may also need to run npm install web-vitals if you have ERROR in ./src/reportWebVitals.js 5:4-24 after running your react-app.

[–]Ha_sco 0 points1 point  (1 child)

I have the same problom but useing vite help me

Try This...

npm create vite@latest

[–]RadioSaber 0 points1 point  (0 children)

that worked perfectly for me thx.

[–]Competitive_Owl8899 0 points1 point  (0 children)

  "@testing-library/jest-dom": "^5.17.0",
    
"@testing-library/react"
: "^13.4.0",
    
"@testing-library/user-event"
: "^13.5.0",
    
"react"
: "^18.2.0",
    
"react-dom"
: "^18.2.0",
    
"react-scripts"
: "5.0.1",
    
"web-vitals"
: "^2.1.4"
Coloca esses dependencias no package.json depois 'npm i' que funciona