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

Amplify React Native dependency incompatible with latest version of react-native #10017

Closed
3 tasks done
iartemiev opened this issue Jun 23, 2022 · 3 comments
Closed
3 tasks done
Assignees
Labels
React Native React Native related issue

Comments

@iartemiev
Copy link
Member

iartemiev commented Jun 23, 2022

Before opening, please confirm:

JavaScript Framework

React Native

Environment information

 System:
    OS: macOS 12.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 11.22 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - /usr/local/bin/node
    Yarn: 1.22.5 - ~/.yarn/bin/yarn
    npm: 8.11.0 - /usr/local/bin/npm
    Watchman: 2022.06.13.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 102.0.5005.115
    Chrome Canary: 105.0.5135.0
    Firefox: 99.0.1
    Safari: 15.5
  npmPackages:
    @babel/core: ^7.12.9 => 7.18.5
    @babel/runtime: ^7.12.5 => 7.18.3
    @react-native-community/eslint-config: ^2.0.0 => 2.0.0
    HelloWorld:  0.0.1
    babel-jest: ^26.6.3 => 26.6.3
    eslint: ^7.32.0 => 7.32.0
    hermes-inspector-msggen:  1.0.0
    jest: ^26.6.3 => 26.6.3
    metro-react-native-babel-preset: ^0.70.3 => 0.70.3
    react: 18.0.0 => 18.0.0
    react-native: 0.69.0 => 0.69.0
    react-test-renderer: 18.0.0 => 18.0.0
  npmGlobalPackages:
    @aws-amplify/cli: 9.0.0
    corepack: 0.10.0
    npm: 8.11.0

Describe the bug

Customers are unable to install aws-amplify via npm into React Native applications using the latest version of react-native@0.69.0 released 6/22/22.

React Native 0.69.0 updated its React dependency to react@18.x. One of the AmplifyJS React Native dependencies react-native-picker/picker doesn't yet support this version per its peer dependency list.

We should explore whether we can provide a short term resolution to customers until the picker team updates its peer dep. It would be worth opening a GitHub issue in their repo requesting that change.

As a workaround, customers can use the --legacy-peer-deps flag when using npm install to ignore peer dependency warnings.

Note: this issue is specific to customers installing aws-amplify via npm at version >= 7. Customers using yarn will not experience this issue.

Expected behavior

It should be possible to install aws-amplify into a new React Native project using the latest version of RN.

Reproduction steps

$ npx react-native@latest init amplify_rn
$ cd amplify_rn
$ npm install aws-amplify aws-amplify-react-native amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage @react-native-picker/picker

Workarounds

  • Use --legacy-peer-deps when installing picker npm install @react-native-picker/picker --legacy-peer-deps
  • Use an older version of react-native npx react-native@0.68.0 init $PROJECTNAME --version 0.68.0
  • Use a package manager that doesn't enforce peer dependencies such as yarn or npm prior to 7
@stocaaro
Copy link
Member

I have opened an issue with the @react-native-picker/picker library and updated the getting started guide recommending users getting started use the last working version of react-native to avoid running into this issue.

When @react-native-picker/picker is compatible with the latest version of react-native we will roll back the docs update.

@iartemiev
Copy link
Member Author

Leaving this here as a reminder:
We'll need to revert these changes in our canaries after this issue has been resolved.

@israx
Copy link
Member

israx commented Jul 31, 2022

I'm facing the same issue.

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

No branches or pull requests

5 participants