wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

push to new Screen,crash! #1010

Closed charlesluo2014 closed 7 years ago

charlesluo2014 commented 7 years ago

Issue Description

When push to a new Screen,in release mode crash!

[tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: JSON.stringify cannot serialize cyclic structures. 2017-04-08 11:56:58.312 VRCNewsApp[40780:4114994] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: JSON.stringify cannot serialize cyclic structures.', reason: 'Unhandled JS Exception: JSON.stringify cannot serialize cyclic structures., stack: runApplication@344:1050 value@20:2722

@20:838 @20:106 value@20:810 ### Steps to Reproduce / Code Snippets / Screenshots push screen --- ### Environment * React Native Navigation version: 2.0.0-experimental.0 * React Native version: 0.43.2 * Platform(s) (iOS, Android, or both?): iOS * Device info (Simulator/Device? OS version? Debug/Release?): 10.31
lipingruan commented 7 years ago

object circle reference. example:

let a = { }; let b= { ref: a }; a.ref = b;

a or b could not serialize. check your code.

charlesluo2014 commented 7 years ago

@lipingruan It is ok in debug mode,and react-native version 0.41.2 is ok too,0.42 above was crashed !

markymc commented 7 years ago

I'm seeing this problem too on version 1.1.134 and RN v0.44.3. I think it's because I'm using normalizr's denormalize method. Does anyone have any workarounds? I guess I could just pass the ID and denormalize in my component.