stream-chat-react-native icon indicating copy to clipboard operation
stream-chat-react-native copied to clipboard

App crash when trying to debug with Flipper running

Open hongkheng opened this issue 3 years ago • 0 comments

Describe the bug

Our app is facing this issue which the web socket connection from the stream client is unable to be intercepted or listened by Flipper and it will crash the app during local development debugging.

Below are the error logs thrown in the console:

Possible Unhandled Promise Rejection (id: 3):
TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'StreamChat'
    |     property 'wsConnection' -> object with constructor 'StableWSConnection'
    --- property 'client' closes the circle
registerWarning @ LogBox.js:173
console.warn @ LogBox.js:71
overrideMethod @ backend.js:2170
(anonymous) @ instrument.js:111
onUnhandled @ reactnativeerrorhandlers.js:63
onUnhandled @ reactnativeerrorhandlers.js:76
onUnhandled @ rejection-tracking.js:71
(anonymous) @ JSTimers.js:214
_callTimer @ JSTimers.js:112
callTimers @ JSTimers.js:357
__callFunction @ MessageQueue.js:419
(anonymous) @ MessageQueue.js:116
__guard @ MessageQueue.js:370
callFunctionReturnFlushedQueue @ MessageQueue.js:115
(anonymous) @ debuggerWorker.aca173c4.js:4

TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'StreamChat'
    |     property 'wsConnection' -> object with constructor 'StableWSConnection'
    --- property 'client' closes the circle
    at JSON.stringify (<anonymous>)
    at Connection.send (index.js:48:46)
    at index.js:98:35
    at index.js:27:16
    at dispatch (redux.js:667:28)
    at _callee$ (shared.js:500:3)
    at tryCatch (runtime.js:63:40)
    at Generator.invoke [as _invoke] (runtime.js:294:22)
    at Generator.next (runtime.js:119:21)
    at tryCatch (runtime.js:63:40)

It will be un-thinkable for the team to look for another react native debugger client other than Flipper since it is recommended to use it for debugging.

Dev environment info (please complete/provide the following information):

  • Package version (stream-chat-react-native) v4.7.2
  • react-native 0.67.4
  • Emulator (iOS 15.5) macOS Monterey 12.4

To Reproduce

  • Create sample react-native with flipper
  • Initialised stream chat
  • Run metro and flipper running
  • See app crash

Expected behavior

  • App not to crash or throw errors

hongkheng avatar Jul 04 '22 17:07 hongkheng