Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to React 19, have multiple errors when create a new project #1372

Closed
yhojann-cl opened this issue Dec 25, 2024 · 2 comments
Closed

Comments

@yhojann-cl
Copy link

yhojann-cl commented Dec 25, 2024

When create a new project says:

npx create-react-app app

Creating a new React app in /.../app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...


added 1319 packages in 8s

264 packages are looking for funding
  run `npm fund` for details

Initialized a git repository.

Installing template dependencies using npm...
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: app@0.1.0
npm error Found: react@19.0.0
npm error node_modules/react
npm error   react@"^19.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^18.0.0" from @testing-library/react@13.4.0
npm error node_modules/@testing-library/react
npm error   @testing-library/react@"^13.0.0" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

The main react script for create a new project use the @testing-library/react using a old version an cause a conflict with the main package.

Please, upgrade the react package from 18 to 19.

For more information see the apocalypse post from react scripts repository:

Symilar issue 2 years ago when react upgrade to 18:

Please be more careful with the versions so that the react project builder doesn't break every time they are updated.

@MatanBobi
Copy link
Member

Hi @yhojann-cl.. This should probably be updated in CRA but AFAIK it is deprecated so I'm not sure they'll accept a PR.
I'll issue something there. I'm resolving this issue as it's not related to RTL and better be handled in CRA repo.

@MatanBobi
Copy link
Member

I've created facebook/create-react-app#13738, I'll work with the team to hopefully push this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants