-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot determine default value of object in 0.4.2-rc1 #205
Comments
Thanks for the bug report! As you can see from the stack trace, this comes from this JS code: https://github.com/software-mansion/react-native-reanimated/blob/master/src/core/InternalAnimatedValue.js#L8 The error message is emitted when the argument passed to
JSC also throws an exception with these inputs, but it's different: "TypeError: No default value". Google does find some instances of this error in RN apps, but not related to reanimated as far as I can tell. I do see that there is code in reanimated which is conditional on the existence of If you can reproduce this in the play store, there's a couple things to try:
More generally, I would approach this as a bug in JS code, and determine what is causing the invalid input, or come up with a repro case which demonstrates that JS is not behaving according to spec for some particular code or input. I don't have a theory as to why this behaves differently on different android versions. |
@mhorowitz I'm really confused about this one. I can confirm that 0.4.1 works fine. The best log I'm able to do around
Sadly it isn't symbolicated so not sure what to do about it. I've also gotten this on Android 5 only...
I find the different behavior on different devices / android versions very odd. Certain work perfectly fine. This is really hard to test for me since I can't repro on a local device. Also I also played with the code in reanimated a bit. The interesting parts I found is const proxyHandler = {
get: function(target, name) {
if (name === '__isProxy') { // <- Returns true for __isProxy
return true;
}
if (!target[name] && name !== '__val') {
target[name] = new Proxy({}, proxyHandler);
}
return target[name];
},
[...]
}; Then https://github.com/software-mansion/react-native-reanimated/blob/2a48891a6c626bc336ba64ca54e785fbdac501f4/src/core/AnimatedBlock.js#L36 is in the code path that leads to where the crash happens. It should prevent proxies from reaching the
Will report back if I find anything else when I get more time to investigate. |
@janicduplessis thanks for digging in. I agree, this is all very strange. The native crash should definitely not happen. My general suggestion would be to rebuild hermes with symbols, but unfortunately, I'm not sure how to tell you to do that with cmake. I don't envy you trying to debug this without having a local repro. We get those from time to time and they are very hard to debug. I think my best thought right now is to add instrumentation down the call path to try to trace where the value is being created. At least this is happening at initialization, which should be more or less deterministic. Thanks for your efforts! |
I'm getting a similar but equally opaque "Cannot determine default value of object" issue that comes from this line: https://github.com/software-mansion/react-native-reanimated/blob/master/src/core/AnimatedOperator.js#L76 I wish I had more information but the stack trace is useless. Same library though.. |
@arlyon Someone else reported that the version of the Are you using this plugin, and which version of it are you using? Does changing it affect the behavior? If you were willing to take the time to post a standalone JS file which fails, or even app which we could compile to reproduce the failure, then we could probably get to the bottom of this. Unfortunately, we don't yet have enough information to understand this bug. |
Hi, I am running 7.9.5 and will try out 7.8.x, but the issue appears intermittently so some more testing will be needed to confirm. Thanks for the tip. |
@janicduplessis and others: With the recent release of hermes 0.5.1 and 0.5.2-rc1 (Proxy opt-in), we are also now publishing unstripped libraries in the github releases which at long last give us the ability to symbolicate native crashes. If you seen native crashes with Proxy in the past, please try to repro with RN 0.63 and Hermes 0.5.2-rc1. If you get a crash, please post it. You can also try to symbolicate it yourself using the instructions at https://github.com/facebook/hermes/blob/master/doc/ReactNativeIntegration.md#reporting-native-crashes Thanks! |
@mhorowitz I just tested 0.5.2-rc1 and the crash does not seem to happen anymore. I will keep further testing and report back if I get any crash. |
@mhorowitz Hi, I've got the same issue. RN0.62.2 As you explained this issue comes with reanimated lib. But I notice interesting thing.
PS: I'm not sure that this way fixes this bug fully but it worked for me |
For posterity -- I found this bug in a library that was using proxies to return a http request. When trying to console.log the object |
Fixes honojs#2509 When a hono client is instantiated in expo and then console.log(client) is called, an error is thrown: `TypeError: Cannot determine default value of object` This is because the hermes javascript engine expects `new String(val)` to always return a string. But the proxy object would return a ClientRequestImpl object instead. This commit makes a string / function returned in the cases where .toString() and .valueOf() is called on the function.name or function respectively. Also see facebook/hermes#205
Fixes honojs#2509 When a hono client is instantiated in expo and then console.log(client) is called, an error is thrown: `TypeError: Cannot determine default value of object` This is because the hermes javascript engine expects `new String(val)` to always return a string. But the proxy object would return a ClientRequestImpl object instead. This commit makes a string / function returned in the cases where .toString() and .valueOf() is called on the function.name or function respectively. Also see facebook/hermes#205
Fixes honojs#2509 When a hono client is instantiated in expo and then console.log(client) is called, an error is thrown: `TypeError: Cannot determine default value of object` This is because the hermes javascript engine expects `new String(val)` to always return a string. But the proxy object would return a ClientRequestImpl object instead. This commit makes a string / function returned in the cases where .toString() and .valueOf() is called on the function.name or function respectively. Also see facebook/hermes#205
Fixes honojs#2509 When a hono client is instantiated in expo and then console.log(client) is called, an error is thrown: `TypeError: Cannot determine default value of object` This is because the hermes javascript engine expects `new String(val)` to always return a string. But the proxy object would return a ClientRequestImpl object instead. This commit makes a string / function returned in the cases where .toString() and .valueOf() is called on the function.name or function respectively. Also see facebook/hermes#205
…2510) Fixes #2509 When a hono client is instantiated in expo and then console.log(client) is called, an error is thrown: `TypeError: Cannot determine default value of object` This is because the hermes javascript engine expects `new String(val)` to always return a string. But the proxy object would return a ClientRequestImpl object instead. This commit makes a string / function returned in the cases where .toString() and .valueOf() is called on the function.name or function respectively. Also see facebook/hermes#205
I'm getting this error after updating to 0.4.2-rc1.
It happens on app launch. Seem to be triggered by requiring react-native-reanimated.
I cannot reproduce the issue in the simulator (release) and it doesn't seem to happen in all versions of android. I noticed it in the play store pre-launch report. Here's the breakdown of android versions and if the crash happened.
Using RN master @ fb9a7be
The text was updated successfully, but these errors were encountered: