React Native: "ownKeys target is non-extensible but key is missing from trap result" when calling Object.entries #874
Unanswered
ganselu
asked this question in
Bug report
Replies: 3 comments 3 replies
-
Thanks for reporting. Is this latest RN? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hey @dai-shi 👋 were you able to find the cause of this issue? |
Beta Was this translation helpful? Give feedback.
1 reply
-
@dai-shi I'm able to reproduce the issue with the latest version of React Native and Expo. Actually, the issue happens also after trying to console log the state. The issue is caused by the "configurable" option in the createSnapshotDefault function: const desc: PropertyDescriptor = {
value,
enumerable: enumerable as boolean,
// This is intentional to avoid copying with proxy-compare.
// It's still non-writable, so it avoids assigning a value.
configurable: true, // This option is causing the crash on RN
} Although I have no idea why |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When calling Object.entries / .keys / .values on a store entry with only primitives an exception is thrown
"ownKeys target is non-extensible but key is missing from trap result"
Issue only reproducible on Native Devices (Tested on Android and iOS)
Example:
https://snack.expo.dev/fyFeNWh0tFKuA5eA0rlCM
Beta Was this translation helpful? Give feedback.
All reactions