Skip to content
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

Reanimated Crashes in Expo SDK 51.0.11 | "TypeError: animatedRef.getTag is not a function (it is undefined)" #6113

Open
chadders404 opened this issue Jun 12, 2024 · 3 comments
Labels
Close when stale This issue is going to be closed when there is no activity for a while Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@chadders404
Copy link

chadders404 commented Jun 12, 2024

Description

Since upgrading to SDK 51.0.11, my apps using Reanimated crash. Below is the error:

TypeError: animatedRef.getTag is not a function (it is undefined)

Source of the error is indicated to be in useScrollViewOffset.ts line 105:9:

  if (scrollRefTag === null) {
      console.warn(
        '[Reanimated] ScrollViewOffset failed to resolve the view tag from animated ref. Did you forget to attach the ref to a component?'
      );
    } else {
      eventHandler.workletEventHandler.registerForEvents(scrollRefTag.current);
    }

I am running SDK 51.0.11 and Reanimated ~3.10.1. The apps were working fine in Expo SDK 50.0.14.

As this has happened on a couple of apps and is reproducable in a snack, I'm enclined to say this is an issue with Reanimated or the SDK.

Steps to reproduce

  1. Be using Expo SDK 51 and Reanimated ~3.10.1
  2. Import useScrollViewOffset and useAnimatedRef from react native reanimated

Snack or a link to a repository

https://snack.expo.dev/@chadders404/reanimated-crash-expo-sdk-51

Reanimated version

~3.10.1

React Native version

0.74.2

Platforms

iOS

JavaScript runtime

None

Workflow

Expo Go

Architecture

None

Build type

None

Device

Real device

Device model

iPhone 11 Pro

Acknowledgements

Yes

@github-actions github-actions bot added Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided labels Jun 12, 2024
@szydlovsky
Copy link
Contributor

szydlovsky commented Jun 14, 2024

Hey @chadders404, yeah there were some design issues with the code of useScrollViewOffset. It should be fixed in 3.12 version though - let me know if it helps!

@szydlovsky szydlovsky added the Close when stale This issue is going to be closed when there is no activity for a while label Jun 18, 2024
@oddanderson
Copy link

oddanderson commented Jun 21, 2024

Hi sorry if this is a dumb question, as I'm still learning web/expo coming from backend. Expo is still pulling in 3.10, so it seems like 3.12 might be a ways out. Is there a way to upgrade to 3.12 using expo?

If I use npm to manually install 3.12 of react-native-animated, I get a ton of warnings that I shouldn't be doing so. Currently web deploy is broken until I can pull this fix in. This is my error, which I assume is the same:

Unexpected nativeTag: function; nativeTag=[object HTMLDivElement] 

			createBottomSheetScrollableComponent's ScrollableComponent needs to return 
			a reference that contains a nativeTag to a Native HostComponent.

			ref=component => {
        // enters when ref is set by attaching to a component

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Jun 21, 2024
@szydlovsky
Copy link
Contributor

@oddanderson I suggest that you create a development build instead. It lets you install any native libraries you want (so, bumping the Reanimated as well). More info on development builds can be found here: https://docs.expo.dev/develop/development-builds/introduction/

@szydlovsky szydlovsky added the Close when stale This issue is going to be closed when there is no activity for a while label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale This issue is going to be closed when there is no activity for a while Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests

3 participants