awslabs / aws-mobile-appsync-sdk-js

JavaScript library files for Offline, Sync, Sigv4. includes support for React Native
Apache License 2.0
916 stars 265 forks source link

aws-appsync-react not installing in React 18 #745

Closed sidathm closed 11 months ago

sidathm commented 1 year ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? I'm trying to create a PWA app with react 18 that has offline capabilities with AppSync non-DynamoDB resolvers. When I try to install packages I get below error image

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Set up Node 18
  2. Create a new React 18 project with create react app (npx create-react-app pwa-offline-poc-with-mobile-appsync --template typescript)
  3. Install the dependencies (npm i aws-appsync aws-appsync-react react-apollo)

What is the expected behavior? It should be compatible with react 18 and install properly

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? OS: Mac 13.4.1 Node: v18.12.1 React: 18.2.13

sidathm commented 1 year ago

If someone has used this with an earlier version of React for offline capabilities, appreciate if I can get the link to the repo or package.json file to get the exact version numbers

david-mcafee commented 12 months ago

@sidathm - Taking a look at this now, but also wanted to clarify that the AWS AppSync SDK for JavaScript (V2) is now in Maintenance Mode until June 30th, 2024. This means that we will continue to include updates to ensure compatibility with backend services and security. No new features will be introduced in the AWS AppSync SDK for JavaScript (V2).

Since it sounds like your app is a POC, I'd suggested reviewing the upgrade guide for recommended next steps.

david-mcafee commented 11 months ago

@sidathm - Given that the AppSync SDK V2 is in maintenance mode, we will not be adding support for the aws-appsync-react package beyond React version 16.x. Please see my previous comment for a link to the upgrade guide.

Since you mentioned that you are looking to build an app with offline capabilities, I would recommend taking a look at Amplify DataStore.

Please reach out if you have any further questions or concerns! Thank you!