Skip to content

can't update from 0.56.0-rc.2 to 0.56.0 with react-native-git-upgrade #20134

Closed
@macrozone

Description

@macrozone

Environment


  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
      Memory: 112.96 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.9.4 - /usr/local/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 5.6.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 26.0.1, 26.0.2, 27.0.3
        API Levels: 21, 23, 25, 26, 27
    IDEs:
      Android Studio: 3.0 AI-171.4443003
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      @storybook/react-native: ^3.4.7 => 3.4.8
      react: 16.3.2 => 16.3.2
      react-native: 0.56.0-rc.2 => 0.56.0-rc.2

Description

I get this error when running react-native-git-upgrade:

git-upgrade info Check for updates
git-upgrade info Using yarn 1.7.0
git-upgrade info Read package.json files
git-upgrade info Check declared version
git-upgrade info Check matching versions
git-upgrade info Check React peer dependency
git-upgrade info Check that Git is installed
git-upgrade info Get information from NPM registry
git-upgrade info Upgrading to React Native 0.56.0, React 16.4.1
git-upgrade info Setup temporary working directory
git-upgrade info Configure Git environment
git-upgrade info Init Git repository
git-upgrade info Add all files to commit
git-upgrade info Commit current project sources
git-upgrade info Create a tag before updating sources
git-upgrade info Generate old version template
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Plugin 0 specified in "/path/to/git/myApp/node_modules/babel-preset-react-native/index.js" provided an invalid property of "default" (While processing preset: "/path/to/git/myApp/node_modules/babel-preset-react-native/index.js")
    at Plugin.init (/path/to/.config/yarn/global/node_modules/babel-core/lib/transformation/plugin.js:131:13)
    at Function.normalisePlugin (/path/to/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:152:12)
    at /path/to/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
    at Array.map (<anonymous>)
    at Function.normalisePlugins (/path/to/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/path/to/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at /path/to/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
    at /path/to/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (/path/to/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)

Reproducible Demo

update to 0.56.0-rc.2, then to 0.56.0

Activity

yurtaev

yurtaev commented on Jul 13, 2018

@yurtaev

Workaround:

$ yarn add -D babel-preset-react-native@^4
$ react-native-git-upgrade
# then
$ yarn add -D babel-preset-react-native@^5
kelset

kelset commented on Jul 13, 2018

@kelset
Contributor

👋 there.
It seems that, as @yurtaev pointed out, your issue is related to babel-preset-react-native. As we point out in the Changelog, we recommend that you use the fixed versions for both the preset and babel.

Moreover, if you have issues with git-upgrade I also suggest that you keep an eye out on the rn-diff repo to make sure you update all the required files accordingly (example, in your info section you still have react 16.3 instead of 16.4).

Generally, if git upgrade fails I always do it manually by following the basic steps in the rndiff repo and then handle flow (if you are using it).

locked as resolved and limited conversation to collaborators on Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yurtaev@macrozone@kelset@react-native-bot

        Issue actions

          can't update from 0.56.0-rc.2 to 0.56.0 with react-native-git-upgrade · Issue #20134 · facebook/react-native