software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
9.03k stars 1.3k forks source link

[3.4.0 nightly] isWeb is not a function on decay.ts #4656

Closed efstathiosntonas closed 8 months ago

efstathiosntonas commented 1 year ago

Description

On yesterday’s nightly 3.4.0-nightly-20230629-1fa467e6a it throwed this error:

`facebook::jsi::JSError: isWeb is not a function (it is Object)

TypeError: isWeb is not a function (it is Object) at anonymous (JavaScript:1:103) at anonymous (JavaScript:1:1813) at apply (native) at runWorklet (JavaScript:1:207) at anonymous (JavaScript:1:886) at handleAndFlushAnimationFrame (JavaScript:1:147)

0 unknown file -0x4 unknown method`

I use this library to display full screen gallery: https://github.com/Flair-Dev/react-native-awesome-gallery

Steps to reproduce

  1. Install yesterday’s nightly 3.4.0-nightly-20230629-1fa467e6a

Snack or a link to a repository

*

Reanimated version

3.4.0 nighlty

React Native version

0.72.1

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

iPhone 13

Acknowledgements

Yes

github-actions[bot] commented 1 year ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] commented 1 year ago

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

efstathiosntonas commented 1 year ago

some more context, while swiping down the image I get this error:

Simulator Screenshot - iPhone 14 Pro Max - 2023-07-01 at 19 32 53

https://github.com/software-mansion/react-native-reanimated/blob/7143b1e049ba721b51ba570e2e22eb7f00672196/src/reanimated2/animation/decay.ts#L52

the error on first comment is from Bugsnag in release mode and it's misleading :(

With 3.3.0 I do not get such error.

efstathiosntonas commented 1 year ago

after reverting this commit https://github.com/software-mansion/react-native-reanimated/commit/74e5f1a69dd316fb11e93eb613bfd6198275bd98 (on decay.ts only) everything is back to normal.

this line: https://github.com/software-mansion/react-native-reanimated/blob/7143b1e049ba721b51ba570e2e22eb7f00672196/src/reanimated2/animation/decay.ts#L52 should be outside the 'worklet' and not inside the function.

tomekzaw commented 1 year ago

@efstathiosntonas Thanks a lot for the investigation! This is the change that I've introduced in #4594:

Zrzut ekranu 2023-07-2 o 10 28 34

For some reason, this assignment was moved to inside a worklet in #4519, probably while resolving Git conflicts:

Zrzut ekranu 2023-07-2 o 10 29 14

We will submit a fix soon, thanks again!

efstathiosntonas commented 1 year ago

great, thanks @tomekzaw, keep it up!

tomekzaw commented 1 year ago

@efstathiosntonas Obviously, if you would like to submit a PR, feel free to do so (since you're the one who found the root cause of the issue and we appreciate it!)

angelica-snowit commented 1 year ago

I got this error in production, tracked by crashlitycs, on v3.4.0

angelica-snowit commented 11 months ago

I confirm the error in production (a lot of logs) also on v3.5.4

tomekzaw commented 11 months ago

@angelica-snowit how about 3.6.1?

tomekzaw commented 11 months ago

@angelica-snowit Thanks for letting us know, asked @m-bert to investigate this issue.

angelica-snowit commented 11 months ago

@angelica-snowit how about 3.6.1?

I can track this error only on crashlitycs (never experienced on my devices). Next release I will upgrade to latest version and I will let you know!

m-bert commented 11 months ago

Hi @angelica-snowit! I've just checked our codebase and I haven't found any place where we call isWeb inside of a worklet. Would it be possible for you to share some of the logs that you've mentioned? Maybe they will help identify root of that problem.

angelica-snowit commented 11 months ago

com.ionicframework.snowit577025_issue_e1a16a3afaec3f534223c67e39b4797e_crash_session_656DAC75033700014ADEE5FC20C26CD8_DNE_0_v2_stacktrace.txt

m-bert commented 11 months ago

I looked into this stack trace and unfortunately it doesn't help much. The error Object is not a function is too general to tell what actually fails. Would you be able to give as any additional information? Like a part of source code which fails? I know you said that you only have logs from crashlitycs, but without further information it will be difficult to figure out why your app crashes.

angelica-snowit commented 11 months ago

I looked into this stack trace and unfortunately it doesn't help much. The error Object is not a function is too general to tell what actually fails. Would you be able to give as any additional information? Like a part of source code which fails? I know you said that you only have logs from crashlitycs, but without further information it will be difficult to figure out why your app crashes.

Sadly, these are the only info I have, the log is the full Crashlytics log. I just can tell the error is inside the handleAndFlushAnimationFrame function. It happens on different screens that doesn't have anything in common and, more important, don't have any animation.

Latropos commented 8 months ago

Closing, since the bug in issue description "isWeb is not a function on decay.ts" is already solved

efstathiosntonas commented 8 months ago

@Latropos thanks, totally forgot about this one!