Proxy with `preventExtensions` got error: ownKeys target is non-extensible but key is missing from trap result
Bug Description
When I use valtio in expo, I got an error: ownKeys target is non-extensible but key is missing from trap result.
This error does not happen when I configure the js engine to jsc.
- [x] I have run
gradle cleanand confirmed this bug does not occur with JSC
Hermes version: (sorry, I do not know how to get the version, you can check the reproduce repo.) React Native version (if any): 0.71.8 OS version (if any): Android 13 Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): arm64-v8a expo: SDK 48
Steps To Reproduce
- setup expo dev, and run
npm run android - click detail button
code example:
https://github.com/lovetingyuan/expo-example
The Expected Behavior
no error.
Hi @lovetingyuan and thank you for reporting this.
Unfortunately we are unable to debug entire applications with dependencies in order to reproduce and identify issues. Can you please reproduce the error in a minimal example with no dependencies, executing in the Hermes CLI? Thanks!
I am sorry I can not offer a pure javascript example, @pastelmind could you offer more information perhaps. Maybe you can take a look at https://github.com/pmndrs/valtio/issues/765.
#1065 narrows the problem down to a potentially misbehaving defineProperty trap in Proxy. I'm happy to continue the discussion over there.
Ok, thanks, If you confirm that https://github.com/pmndrs/valtio/discussions/764 and https://github.com/pmndrs/valtio/pull/752 has the same reason that is described in https://github.com/facebook/hermes/issues/1065, I will close this issue.
I have reasons to believe https://github.com/pmndrs/valtio/pull/752 is not the actual cause. I initially thought it was, but my investigations indicate that https://github.com/pmndrs/valtio/pull/760 may be the culprit. If the Hermes devs verify that #1065 is a bug, then it would confirm my hypothesis. Let's keep this issue open for now.