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.

`react-native upgrade` has gradually become completely useless

See original GitHub issue

I’ve been developing with react-native for over a year now and I love it.

The only major issue with it for me is the state of running react-native upgrade.

It only seems to work if you’re using a blank project or a very simple one. You start doing any serious work on a project and it may as well not exist.

I thought I’d give it another try to upgrade to 0.62 rc 2 since I wanna give Flipper a try.

Here’s the output

warn Excluding files that exist in the template, but not in your project:
  - App.js
  - ios/appname.xcodeproj/xcshareddata/xcschemes/appname-tvOS.xcscheme
error Excluding files that failed to apply the diff:
  - .gitignore
  - android/app/build.gradle
  - android/app/src/main/AndroidManifest.xml
  - android/app/src/main/java/com/appname/MainApplication.java
  - android/build.gradle
  - android/gradle.properties
  - android/gradle/wrapper/gradle-wrapper.properties
  - android/gradlew
  - android/gradlew.bat
  - ios/Podfile
  - ios/appname.xcodeproj/project.pbxproj
  - ios/appname.xcodeproj/xcshareddata/xcschemes/appname.xcscheme
  - ios/appname/AppDelegate.m
  - ios/appnameTests/appnameTests.m

Wow. So helpful lmao.

Sarcasm aside and I know this is a very tough task – but is there anyway to realistically improve this tool? My project setup is pretty standard with a modest amount of dependencies.

As the the last year or so have went on it’s went from a couple files needing manual updates (mostly the podfile) to sometimes all of the files needing manual updates.

Just wanted to throw this out here as a issue and see if anyone else is having trouble. Could there be something I am doing wrong?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mjmasncommented, Jan 29, 2020

@bobber205 I’ve never managed to get it to work except with a blank project so you’re not alone 🤷‍♂️

Best option for upgrading is semi-manually via https://react-native-community.github.io/upgrade-helper/ - 90% of the time it’s really helpful. It sometimes has some issues with stuff like incorrectly telling you to downgrade dependencies or remove files where changes have been made on a release branch of this repo and not cherry-picked back to master before the next release branch is cut. Feels like there should be a better process around those kind of changes but other than that the technique itself is pretty solid (diffing two new apps created with the two versions you’re trying to upgrade between)

2reactions
kelsetcommented, Jan 29, 2020

👋 @bobber205!

So, first off I would like to check with you that you are using the correct react-native upgrade command - because there is a likely chance that you are still using the old react-native CLI which was embedded in the main repo - it was extracted to its own repo -> https://github.com/react-native-community/cli (yes, it’s a bit confusing sadly 😓)

Currently the new react-native CLI is at v3, and I think you should be able to check which version you are using via react-native -v (or react-native --version? Can’t really recall). As a rule of thumb, if you installed the cli via npm install -g react-native-cli you are using the old version (because of limitations of npm we can’t remove packages that are already published AFAIK).

My guts would tell me that if you are trying to upgrade from v0.61 and you do yarn react-native upgrade instead the result may be slightly different.

All of that said, that command in itself is quite complicated to use because of the many changes that land between version, which is why we usually recommend (in particular for RC versions) to do manual upgrades with the help of upgrade-helper, as @mjmasn wrote above.

Last thing - I quickly glanced in the issue section of the dedicated repo and it seems that the upgrade command is not quite perfect yet (https://github.com/react-native-community/cli/issues/926).

What I would recommend is that you check your version of the CLI, try again, then if you are still having issues/ finding bugs you open a new issue in the new repo and close this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optimizing React Native performance - LogRocket Blog
Solve your React Native app performance issues, like console statements and animations, using these optimization tools.
Read more >
`react-native start` takes long time
Then I upgrade react-native about four months later than I started. React-Native became runs more slowly. Even so it became slower, ...
Read more >
How to Upgrade to React 18
Updates to Client Rendering APIs. When you first install React 18, you will see a warning in the console: ReactDOM.render is no longer...
Read more >
React Native: Upgrade Dos and Don'ts | Shockoe
While React Native is a great framework for cross platform development, the process to upgrade from one version to another is generally pretty...
Read more >
Clarifying Some of the Most Ambiguous Crash Reports in ...
The fact that React-Native is a popular framework and evolves quickly ... was completely useless because nothing was logged on the screen.
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