hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Proxy with `preventExtensions` got error: ownKeys target is non-extensible but key is missing from trap result

Open lovetingyuan opened this issue 2 years ago • 5 comments

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 clean and 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

  1. setup expo dev, and run npm run android
  2. click detail button

code example:

https://github.com/lovetingyuan/expo-example

The Expected Behavior

no error.

lovetingyuan avatar Jul 21 '23 07:07 lovetingyuan

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!

tmikov avatar Jul 21 '23 16:07 tmikov

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.

lovetingyuan avatar Jul 24 '23 03:07 lovetingyuan

#1065 narrows the problem down to a potentially misbehaving defineProperty trap in Proxy. I'm happy to continue the discussion over there.

pastelmind avatar Jul 24 '23 04:07 pastelmind

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.

lovetingyuan avatar Jul 24 '23 04:07 lovetingyuan

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.

pastelmind avatar Jul 24 '23 05:07 pastelmind