aws-mobile-appsync-sdk-js: apollo_cache_inmemory_1.readQueryFromStore is not a function in browser
Do you want to request a feature or report a bug? bug
What is the current behavior? Iβm receiving an error message when trying to process an offline query
ERROR Error: Network error: apollo_cache_inmemory_1.readQueryFromStore is not a function
at new ApolloError (ApolloError.js:37)
at QueryManager.js:335
at QueryManager.js:710
at Array.forEach (<anonymous>)
at QueryManager.js:709
at Map.forEach (<anonymous>)
at QueryManager.push../node_modules/aws-appsync/node_modules/apollo-client/core/QueryManager.js.QueryManager.broadcastQueries (QueryManager.js:704)
at QueryManager.js:284
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:3824)
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
It happens from time to time, only when a query is executed and the store is offline, well, only when my code reaches method processOfflineQuery.
What is the expected behavior? Process the query.
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions? Iβm using, in a angular app in browser (chrome):
"apollo-angular": "^1.5.0",
"apollo-angular-link-http": "^1.4.0",
"apollo-cache-inmemory": "^1.3.9",
"apollo-client": "^2.4.3",
"apollo-link-error": "^1.1.1",
"aws-appsync": "^1.4.0",
The store should be hydrated since I do it in app startup.
Thank you
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 16 (5 by maintainers)
@jamesalexmorgan @e23z @luccamordente @iudelsmann
We just published a new version to npm, could you guys test with these:
No more errors for me. Thank you very much!
Youβre fast! Thanks for that.
Same as @e23z here. Same replication steps as well.
Iβve just updated to these versions: aws-appsync-react@1.2.2 aws-appsync@1.5.1
@manueliglesias Thanks a lot! You guys are amazing! The issue is completely gone. π
The only problem I am facing now is this:
But itβs probably some mistake Iβve made or something I misconfigured. And a simple
setTimeoutworkaround to delay my query fixed the problem anyway.@manueliglesias Canβt replicate the issue anymore!!! π π π π π π π π You guys are awesome!!
Iβm seeing pretty much this exact behavior in a react-native app as well. Using the demo app from here: https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app-reactnative.html. It appears the error is thrown but the query is still executed against the offline cache and returning results.