aws-mobile-appsync-sdk-js: @redux-offline Detect network getConnectionInfo of undefined
Hello. I am using the latest version of React Native and Aws AppSync. And I’ve got deprecation issue on @redux-offline dependency. Maybe you want to see my implementation
import Amplify, { Auth } from 'aws-amplify';
import awsconfig from './aws-exports';
import AWSAppSyncClient from 'aws-appsync'
import { Rehydrated } from 'aws-appsync-react'
import { ApolloProvider } from 'react-apollo'
Amplify.configure(awsconfig);
const client = new AWSAppSyncClient({
url: config.aws_appsync_graphqlEndpoint,
region: config.aws_appsync_region,
auth: {
type: config.aws_appsync_authenticationType,
jwtToken: async () => (await Auth.currentSession()).idToken.jwtToken
}
});
const AppWithProvider = () => (
<ApolloProvider client={client}>
<Rehydrated
render={({ rehydrated }) => (
rehydrated ? <App /> : <SplashScreen />
)}
/>
</ApolloProvider>
);
AppRegistry.registerComponent(appName, () => AppWithProvider);
According to this link https://github.com/react-native-community/react-native-netinfo this method is already deprecated. Could you help me round to solve this issue?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 46 (9 by maintainers)
Hi,
We have just released an unstable version that fixes this issue under the
unstable-nativetag for you to use and help us test before we publish to thelatesttag.To try it out, you can do:
You would need to also install
react-native-community/netinfoWhile I wait for the official fix, I have fixed this for my project by adding this to my package.json:
It forces all of my dependencies to use that version of the @redux-offline/redux-offline package.
Very frustrating… nothing works in Appsync if we follow docs… we are wasting time on fixing these rather than focusing on product.
Guys, Is there any working configuration for “react-native”: “0.61.5” ? I’m ok to downgrade dependencies versions to save time and frustration…
Hi, I do believe that this problem resurfaced in latest SDK of Expo, SDK 37. With this packages (some of them that we think are of interest):
These are the warnings we receive. Not very sure what are the packages involved in this, we tried with different versions of react-native, react, aws-amplify (also by using the destructured packages as core, auth, storage). Also I may also point out that the react-apollo 2.x dependency still exists and there is nothing about integrating appsync with react-apollo 3.x. For the moment we will go back to sdk 36 Thank you and sorry if this is not the correct thread!
Hi,
Thank you for the patience, we are actively working on unblocking this and wanted to have a concrete implementation plan before responding. At the very least, giving an option when instantiating the client to override the network detection mechanism so consumers can pass one that e.g. uses
@react-native-community/netinfo.It will look something like this:
We would like to publish a version with this pattern to an unstable dist tag in the following days, hopefully you can help us test it before releasing it to a broader audience.
Thanks @ulziiburend but unfortunately I have no intentions of downgrading from RN0.60.x.
@vadiraja we are very aware of the issue and @manueliglesias is one of the maintainers and commented 3 days back. While we could have commented earlier, we’ve been focusing on solving this and it took a bit of research as well as discussion with some OSS community members and RN team. That being said we had people working on this with progress even today and are optimistically looking to provide a solution early next week.
SDK maintainers are not realizing that it is causing business loss to AWS. People are not getting into App Sync and other services because of this lackluster response. I am seriously consider should I invest in AWS technologies / eco system
All that is needed to fix this is to update the
package.jsonto @redux-offline dependency to2.5.2-native.0. Almost feels like it’s taking too long to fix.@amie-wilt We just released a new version (2.0.0) for the AppSync SDK which supports React Native 0.60. Please give it a try with your app and let us know if everything works as expected.
@sorodrigo Thanks for the update. We are using native.0 as of now, but will test native.1 and upgrade in the next release.
@Ashish5591 Thanks for the quick response.
Can you estimate a timeline for when a decision might be made?
How strongly do you advise against using the unstable version in a production app?
Thank you.
waiting… 😦((
Hi friend quick fix for Net Info error with redux offline use redux-offline version @redux-offline/redux-offline: “2.5.2-native.0”
and if you get error handler is not a function, handler is “change” then use @react-native-community/netinfo: “4.7.0”
read #339 (comment) of @sorodrigo
@norby3 Yes, we have a peer dependency on
"react-apollo": "2.x"and are aware about issues with 3.x @matthamil Thanks for the suggestion. I’ve updated the documentation with setup instructions for RN 0.60Closing this issue now, as AWS AppSync SDK v2.00 supports RN 0.60 and the documentation has been updated as well.
Hi,
Thanks for your patience. We have been actively working on fixing this issue and are testing the changes at this time. We plan to release this soon, and will publish it to an unstable tag initially and look forward to your help in testing it further. Thank you.
Also linking @elorzafe @manueliglesias TLDR; Piggybacking off of @amie-wilt - concerned about maintenance & future of Appsync. Can we expect continued updates & maintenance of this package and Appsync for the next few years?
I spent a day last week upgrading from RN 0.59.x -> 0.60.x and this library is blocking the completion of that upgrade. It is worrisome to see the lack of activity from the major contributors…
I’ve been using Appsync in my project for the last year & am currently entering beta testing. Obviously I hope to continue using the service, but I would love some information about its future. Will Amazon continue to support it & maintain the packages that support it?
@manueliglesias First and foremost, thank you for you contributions to this project.
I noticed you responded to @cmmouritsen’s comment with a rocket emoji, and therefore I can safely assume you’ve seen this issue. As @usmansbk pointed out, the Rehydrated component breaks due to an old import of
NetInfofrom"react-native"rather than"@react-native-community/netinfo". Is there any intent to update this package to work with RN 0.60.x any time soon?I’m beginning to worry given the delays on this and the lack of Apollo client update (#369) that this package is going to stop being maintained at some point in the near future. Is that a possibility?
I understand the Apollo client update may be more than just a couple lines but it seems this particular update is rather straightforward and has PRs in the works ready to be reviewed/merged so the lack of activity on this is becoming rather concerning. Please advise.
Thank you.
#434 #445
@cmmouritsen Whoa that’s amazing! I never knew! Thank you!
Sorry to be annoying and add to the noise but I’ve been monitoring this like crazy as it’s a bit of a blocker for me. Why is this taking so long?
Maybe it would be helpful https://github.com/redux-offline/redux-offline/pull/339#issuecomment-514289256