Skip to content

upgrade from 0.56-rc.3 -> 0.56-rc.4 fails #19940

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

Closed
dulmandakh opened this issue Jun 28, 2018 · 12 comments
Closed

upgrade from 0.56-rc.3 -> 0.56-rc.4 fails #19940

dulmandakh opened this issue Jun 28, 2018 · 12 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@dulmandakh
Copy link
Contributor

I use 0.56-rc.3 and it fails to upgrade to 0.56-rc.4 using react-native-git-upgrade next command.

git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Plugin 0 specified in "/Users/x/Projects/Xyyp/node_modules/babel-preset-react-native/index.js" provided an invalid property of "default" (While processing preset: "/Users/x/Projects/Xyyp/node_modules/babel-preset-react-native/index.js")
    at Plugin.init (/Users/x/.config/yarn/global/node_modules/babel-core/lib/transformation/plugin.js:131:13)
    at Function.normalisePlugin (/Users/x/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:152:12)
    at /Users/x/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
    at Array.map (<anonymous>)
    at Function.normalisePlugins (/Users/x/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/x/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at /Users/x/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
    at /Users/x/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (/Users/x/.config/yarn/global/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
git-upgrade ERR! Restore initial sources

Environment

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.5
CPU: x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Memory: 248.71 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.5.0 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.3, macOS 10.13, tvOS 11.3, watchOS 4.3
Android SDK:
Build Tools: 26.0.3, 27.0.3, 28.0.0
API Levels: 26, 27, 28
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 9.3/9E145 - /usr/bin/xcodebuild
npmPackages:
@types/react: ^16.3.14 => 16.4.1
@types/react-native: ^0.55.14 => 0.55.24
react: 16.4.1 => 16.4.1
react-native: 0.56.0-rc.3 => 0.56.0-rc.3

@kelset
Copy link
Contributor

kelset commented Jun 28, 2018

Uhm can you post your package.json? Or is this happening with a clean new project created via react-native init?

Which version of the babel-preset-react-native are you using?


EDIT: it seems like this is the same error posted in #19859, so may be related to jest? Maybe worth closing this issue and keeping the conversation ongoing there?

@dulmandakh
Copy link
Contributor Author

It's a project started with 0.54, then upgraded to 0.55 when released

{
  "name": "proj",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "lodash": "^4.17.10",
    "react": "16.4.1",
    "react-native": "0.56.0-rc.3",
    "react-native-linear-gradient": "^2.4.0",
    "react-navigation": "^2.0.4",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0",
    "redux-persist": "^5.10.0",
    "redux-thunk": "^2.3.0",
    "reselect": "^3.0.1"
  },
  "devDependencies": {
    "@types/lodash": "^4.14.109",
    "@types/react": "^16.3.14",
    "@types/react-native": "^0.55.14",
    "@types/react-navigation": "^2.0.0",
    "@types/react-redux": "^6.0.0",
    "babel-core": "^7.0.0-beta.3",
    "babel-jest": "^23.0.1",
    "babel-preset-react-native": "^5.0.1",
    "jest": "^23.1.0",
    "prettier": "^1.12.1",
    "react-test-renderer": "^16.4.1",
    "typescript": "^2.8.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

@kelset
Copy link
Contributor

kelset commented Jun 28, 2018

Uhm yeah I think it may be these lines:

    "babel-core": "^7.0.0-beta.3",
    "babel-jest": "^23.0.1",
    "jest": "^23.1.0",

Can you check with the other issue I linked #19859 and if upgrading versions fixes it for you?

@dulmandakh
Copy link
Contributor Author

I use yarn to upgrade packages, and it doesn't touch package.json.

Installed @babel/core@^7.0.0-beta.47, babel-core@^7.0.0-beta.47, babel-jest@^23.2.0, babel-plugin-jest-hoist@^23.2.0 and issue still persists.

@kelset
Copy link
Contributor

kelset commented Jun 28, 2018

Understood. Does it happen also with a "fresh project"? Or/and only from rc3 to rc4?

@dulmandakh
Copy link
Contributor Author

Didn't tried with "fresh project", but rc3 to rc4.

@treemore
Copy link

well . i have the same error when upgrade 0.55.3 =>rc4. but when i use babel-preset-react-native:$4.0.0 . this error
ERR! Error: Plugin 0 specified in "/Users/x/Projects/Xyyp/node_modules/babel-preset-react-native/index.js" provided an invalid property of "default" (While processing preset: "/Users/x/Projects/Xyyp/node_modules/babel-preset-react-native/index.js")
gone.

@CrazyPython
Copy link

CrazyPython commented Jun 30, 2018

This worked for me: Edit package.json manually to use the latest version of react native and run yarn install. Fix any peerDependency warnings you get. react-native-git-upgrade failed for me, but my app (which contains native code) works using the aforementioned process.

@dulmandakh
Copy link
Contributor Author

Closing this issue, because I upgraded my project using suggestions provided by @CrazyPython.

@gastonmorixe
Copy link

Can't upgrade same error

Projects/hablemos/code/hablemos-rn · (upgrade)
⟩ npx react-native-git-upgrade
npx: installed 164 in 15.814s
git-upgrade info Check for updates
git-upgrade info Using yarn 1.8.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 "/Users/work1/Projects/hablemos/code/hablemos-rn/node_modules/babel-preset-react-native/index.js" provided an invalid property of "default" (While processing preset: "/Users/work1/Projects/hablemos/code/hablemos-rn/node_modules/babel-preset-react-native/index.js")
    at Plugin.init (/Users/work1/.npm/_npx/74241/lib/node_modules/react-native-git-upgrade/node_modules/babel-core/lib/transformation/plugin.js:131:13)
    at Function.normalisePlugin (/Users/work1/.npm/_npx/74241/lib/node_modules/react-native-git-upgrade/node_modules/babel-core/lib/transformation/file/options/option-manager.js:152:12)
    at /Users/work1/.npm/_npx/74241/lib/node_modules/react-native-git-upgrade/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
    at Array.map (<anonymous>)
    at Function.normalisePlugins (/Users/work1/.npm/_npx/74241/lib/node_modules/react-native-git-upgrade/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/work1/.npm/_npx/74241/lib/node_modules/react-native-git-upgrade/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at /Users/work1/.npm/_npx/74241/lib/node_modules/react-native-git-upgrade/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
    at /Users/work1/.npm/_npx/74241/lib/node_modules/react-native-git-upgrade/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (/Users/work1/.npm/_npx/74241/lib/node_modules/react-native-git-upgrade/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
git-upgrade ERR! Restore initial sources
Note: checking out 'project-snapshot'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 38222f5 Project snapshot

@gastonmorixe
Copy link

ok react-native upgrade did work. how similar is it?

@CrazyPython
Copy link

@gastonmorixe as they say, "Use the source, luke" 😄

@facebook facebook locked as resolved and limited conversation to collaborators Jul 18, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants