React Native: "ownKeys target is non-extensible but key is missing from trap result" when calling Object.entries #874
Replies: 8 comments 7 replies
-
Thanks for reporting. Is this latest RN? |
Beta Was this translation helpful? Give feedback.
-
Hey @dai-shi 👋 were you able to find the cause of this issue? |
Beta Was this translation helpful? Give feedback.
-
@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.
-
Hey guys, any updates on this one? Happens with latest version of Valtio. Not on 1.10.5 though. |
Beta Was this translation helpful? Give feedback.
-
I wonder if the fix in #988 could have fixed this as well? |
Beta Was this translation helpful? Give feedback.
-
Is there any help on this or workaround? I tried even with v1, the same issue |
Beta Was this translation helpful? Give feedback.
-
v1.6.3 is working fine, i tested with the latest react native version |
Beta Was this translation helpful? Give feedback.
-
I think it's an issue even without Valtio. Can anyone help? |
Beta Was this translation helpful? Give feedback.
-
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