question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed React 18 upgrade via nx migrate 13.10

See original GitHub issue

Current Behavior

When running the 13.10 migration, the following changes are made to my package.json:

  • devDependencies
    • Upgraded @types/react to 17.0.43
    • Upgraded @types/react-dom to 17.0.14
  • dependencies
    • Added react-is version 18.0.0
    • Added react-test-renderer version 18.0.0

Note: This migration results in two versions of react-test-renderer: v17 as a dev dependency, and v18 as an actual dependency.

Expected Behavior

Per the 13.10 release notes, nx migrate 13.10 should upgrade to React 18.

I would expect the following package.json changes to be made:

  • devDependencies
    • Upgrade @types/react to 18.0.0
    • Upgrade @types/react-dom to 18.0.0
    • Upgrade react-test-renderer to 18.0.0
  • dependencies
    • Add react-is version 18.0.0
    • Upgrade react to version 18.0.0
    • Upgrade react-dom to version 18.0.0

Steps to Reproduce

  1. Start with a <= 13.9 Nx workstation with react libraries/apps.
  2. Run nx migrate latest
  3. Run npm i
  4. Run nx migrate --run-migrations
  5. Check changes to root package.json

Environment

Node : 16.14.2
OS   : darwin x64
npm  : 8.5.0

nx : 13.10.0
@nrwl/angular : Not Found
@nrwl/cypress : 13.10.0
@nrwl/detox : Not Found
@nrwl/devkit : 13.10.0
@nrwl/eslint-plugin-nx : 13.10.0
@nrwl/express : Not Found
@nrwl/jest : 13.10.0
@nrwl/js : 13.10.0
@nrwl/linter : 13.10.0
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : 13.2.2
@nrwl/nx-plugin : Not Found
@nrwl/react : 13.10.0
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 13.10.0
@nrwl/web : 13.10.0
@nrwl/workspace : 13.10.0
typescript : 4.5.5
rxjs : 6.6.7
---------------------------------------
Community plugins:

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jaysoocommented, Apr 13, 2022

We’ll release a patch soon for 13.10.2.

Workaround for now is to manually update your packages for @types/react, @types/react-dom, react-test-renderer.

0reactions
MichaelDeBoeycommented, Apr 21, 2022

@jaysoo #9613 is not updating the react, react-dom & react-test-renderer version, it’s only adding react-is@18.0.0 in my package.json

This is caused by the fact that it’s using the addDependenciesToPackageJson function, which is literally only adding dependencies, not updating them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React 18 Migration | Nx
For manual update, go to React Native Upgrade Helper and copy the diff to your native code one by one. Nevertheless, you can...
Read more >
What is new in Nx 13.10?
Nx 13.10 introduces support for the latest React v18 release such that users can benefit from the latest features React has to offer....
Read more >
Nx 13 Migration failure: update-tasks-runner - Stack Overflow
Failed to run 13-10-0-update-tasks-runner from @nrwl/workspace. This workspace is NOT up to date! Cannot read property 'default' of undefined.
Read more >
The ultimate migration guide to angular-eslint, ESLint and Nx 11
As of Nx version 11.0.18, angular-eslint version 0.8.0-beta.1 is installed. Let's update it to the latest version. Using NPM CLI:
Read more >
NX Nastran User's Guide - Siemens PLM
Example: Using NX Nastran Input Files to Model a Truss . ... 3-18. Parameters in the Superelement Solution Sequences .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found