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

redux-offline issue or aws-appssync issue? #558

Open
yunau opened this issue Apr 30, 2020 · 2 comments
Open

redux-offline issue or aws-appssync issue? #558

yunau opened this issue Apr 30, 2020 · 2 comments

Comments

@yunau
Copy link

yunau commented Apr 30, 2020

Hi team,

I got the following error when using aws-appsync, and it looks like a bug of redux-offline.
Does "aws-appsync": "^3.0.3" working with expo version 37? Or I have to downgrade to version 36?

Other people have the same issue.
aws-amplify/amplify-js#5359

=========================================================
[Unhandled promise rejection: TypeError: _netinfo.default.getConnectionInfo is not a function. (In '_netinfo.default.getConnectionInfo()', '_netinfo.default.getConnectionInfo' is undefined)]

  • node_modules/@redux-offline/redux-offline/lib/defaults/detectNetwork.native.js:96:14 in _callee2$
  • node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
  • node_modules/regenerator-runtime/runtime.js:274:30 in invoke
  • node_modules/@babel/runtime/helpers/asyncToGenerator.js:2:6 in asyncGeneratorStep
  • node_modules/@babel/runtime/helpers/asyncToGenerator.js:24:6 in _next
  • node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
  • node_modules/promise/setimmediate/core.js:200:23 in doResolve
  • node_modules/promise/setimmediate/core.js:66:12 in Promise
  • node_modules/@babel/runtime/helpers/asyncToGenerator.js:20:15 in
  • node_modules/@redux-offline/redux-offline/lib/defaults/detectNetwork.native.js:224:24 in _default
  • node_modules/@redux-offline/redux-offline/lib/index.js:70:17 in
  • node_modules/redux/lib/applyMiddleware.js:37:30 in
  • node_modules/aws-appsync/lib/store.js:82:4 in newStore
  • node_modules/aws-appsync/lib/client.js:189:120 in AWSAppSyncClient
  • App.js:433:0 in
  • node_modules/metro/src/lib/polyfills/require.js:322:6 in loadModuleImplementation
  • index.js:3:0 in
  • node_modules/metro/src/lib/polyfills/require.js:322:6 in loadModuleImplementation
  • node_modules/metro/src/lib/polyfills/require.js:201:45 in guardedLoadModule

[Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'netinfo_1.default.isConnected.fetch')]

  • node_modules/aws-appsync-react/lib/rehydrated-rn.js:18:40 in fulfilled
  • node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
  • node_modules/promise/setimmediate/core.js:123:25 in setImmediate$argument_0
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:146:14 in _callTimer
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:194:17 in _callImmediatesPass
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:458:30 in callImmediates
  • [native code]:null in callImmediates
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:407:6 in __callImmediates
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:6 in __guard$argument_0
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:142:17 in __guard$argument_0
  • [native code]:null in flushedQueue
  • [native code]:null in callFunctionReturnFlushedQueue

[Unhandled promise rejection: TypeError: handler is not a function. (In 'handler(nextState)', 'handler' is "connectionChange")]

  • node_modules/@react-native-community/netinfo/src/internal/state.ts:65:9 in State#_handleInternetReachabilityUpdate
  • node_modules/@react-native-community/netinfo/src/internal/internetReachability.ts:119:36 in Promise.race.then.then._catch$argument_0
  • node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
  • node_modules/promise/setimmediate/core.js:123:25 in setImmediate$argument_0
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:146:14 in _callTimer
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:194:17 in _callImmediatesPass
  • node_modules/react-native/Libraries/Core/Timers/JSTimers.js:458:30 in callImmediates
  • [native code]:null in callImmediates
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:407:6 in __callImmediates
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:6 in __guard$argument_0
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
  • node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:142:17 in __guard$argument_0
  • [native code]:null in flushedQueue
  • [native code]:null in callFunctionReturnFlushedQueue

I am using
"expo": "~37.0.3",
"aws-appsync": "^3.0.3",
"aws-appsync-react": "^3.0.3",
"react-apollo": "2.5.8",
"@react-native-community/netinfo": "5.5.0".

@theharness
Copy link

See #551. This SDK is not compatible with expo 37. You have to use 36 until the pr is merged.

@orlandokaramani
Copy link

@yunau That’s because no one underlined the importance of the version of @react-native-community/netinfo which should be exactly 4.7.0. This library hasn’t been updated to support the latest version sadly.

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

No branches or pull requests

3 participants