-
Notifications
You must be signed in to change notification settings - Fork 266
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
Unhandled Rejection (TypeError): Cannot read property 'hydrated' of undefined #456
Comments
Tmp workaround This was intermittent for my team. We added the following to a wrapper component and remounted the apollo provider after a timeout if the app did not hydrate
|
@amirmishani are you using react-apollo version 3.x.x? You should use 2.x.x (is a peer dependency of aws-appsync-react) Related to aws-samples/aws-serverless-appsync-app#8 |
@amirmishani the comment by @elorzafe helped me get further along in the grind... [email protected] was the key - b/c by default it will use the 3.x version and causes a cascade of other dependency probs for a react-native app i used something along the lines of: aws-appsync and aws-appsync-react were recently bumped to 2.x i had to change my mindset to pay a lot more attention to the dependencies and the versions - can't expect it to just work - can't expect yarn to just figure it out |
@amirmishani did using react-apollo 2.x.x resolve your issue? |
there is no open-source-goddess ensuring all the node packages place nice together Back with another update on the witches brew of packages:
with the above combination, was able to get first evidence that graphql query worked via appsync - console.log output showing test data from my graphql schema model called "cases": Home.js this.props.cases = [{"uuid":"5b9LAkRITSWsGX74aYPkycnj3BEptJZ0","caseType":"Hello, world!","caseVersion":"Hello, world!","status":"Hello, world!","createdAt":"1970-01-01T12:30:00.000Z" ... another thing is that i'm using the old school high order component (HOC) style and not the swanky new hooks - someday way in the future maybe i'll be sexy and use hooks but after weeks of grinding on this react-native-0.60-appsync-2.0-graphql-apollo app, happy there are signs that the old school way is functioning my takeaway is pay very close attention to your packages & versions - none of 'my' code was wrong or broken - all along it was just the wrong combination of node packages - there is no open-source-goddess ensuring all the node packages place nice together - like sherlock we have to piece it together thru helpful msg boards like this and helpful peeps like @Ashish5591 - ciao for now |
@elorzafe and everybody else who mentioned that react-apollo version needs to be 2.x.x are correct! That did solve the issue. |
@amirmishani Will be there an update on this issue? It's sad to jump one major version down (Apollo client is now 3.7). |
I agree. Would like to be able to use the latest client with modern use syntax for React. |
related to #448 |
For people like me who look for stuff to copy paste. |
|
Do you want to request a feature or report a bug?
bug
What is the current behavior?
creates the following error on screen in react app.
Unhandled Rejection (TypeError): Cannot read property 'hydrated' of undefined
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I was following your own tutorial here. On the second step as soon as you setup the react app it fails.
What is the expected behavior?
Expecting the react app to load.
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?
This is on a desktop Chrome (latest) but the error seems to be independent of browser and OS.
The text was updated successfully, but these errors were encountered: