React Native: "ownKeys target is non-extensible but key is missing from trap result" when calling Object.entries #874
Replies: 10 comments 11 replies
|
Thanks for reporting. Is this latest RN? |
|
Hey @dai-shi 👋 were you able to find the cause of this issue? |
|
@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 |
|
Hey guys, any updates on this one? Happens with latest version of Valtio. Not on 1.10.5 though. |
|
I wonder if the fix in #988 could have fixed this as well? |
|
Is there any help on this or workaround? I tried even with v1, the same issue |
|
v1.6.3 is working fine, i tested with the latest react native version |
|
I think it's an issue even without Valtio. Can anyone help? |
|
I have this issue also! 2025 |
|
This patch did the job for me: |
Uh oh!
There was an error while loading. Please reload this page.
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
All reactions