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

Crash when updating to react-native-reanimated 2.7.0 ( undefined is not a function ) #159

Closed
1987cr opened this issue Apr 12, 2022 · 33 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed needs review The issue has been solved, Wait for confirmation. P1

Comments

@1987cr
Copy link

1987cr commented Apr 12, 2022

Describe the bug
Updating react-native-reanimated to version 2.7.0 seems to be breaking the library, causing crashes on iOS and Android

To Reproduce
Steps to reproduce the behavior:

  1. Update react-native-reanimated to version 2.7.0

Expected behavior
No crashes

Screenshots

Versions (please complete the following information):

  • react: v17.0.2
  • react-native: v0.68.0
  • react-native-reanimated: v2.3.7
  • react-native-reanimated-carousel: v2.3.4
  • react-native-gesture-handler: v2.3.2

Smartphone (please complete the following information):

  • Device: Pixel 4a
  • OS: Android 12
@1987cr 1987cr added the bug Something isn't working label Apr 12, 2022
@dohooo
Copy link
Owner

dohooo commented Apr 12, 2022

Thanks for reminding me to fix it ASAP.

@beetlebum
Copy link

Any workaround for this issue, or estimation for a fix? thanks

@dohooo
Copy link
Owner

dohooo commented Apr 13, 2022

I have been so busy recently that I can only deal with this problem this weekend. Could a rollback be a bad idea?

@dohooo
Copy link
Owner

dohooo commented Apr 13, 2022

https://discord.gg/Ge8bZbpG
Come here for the latest news.

@wilav-dev
Copy link
Contributor

I'm installing the library from npm and this fix is not included. Is it possible?

@diego-paired
Copy link

We're still experiencing issues on the latest build + reanimated 2.8.0

@dohooo dohooo reopened this May 2, 2022
@dohooo
Copy link
Owner

dohooo commented May 2, 2022

I tried to fix this today, However, other problems were introduced, so I revert the commit but forgot to reopen this issue.

@wilav-dev
Copy link
Contributor

I'm adding that line and seems to work. Could you tell me which problem was introduced? Because I'd like to know if i have a bug and haven't noticed. thanks!

@dohooo
Copy link
Owner

dohooo commented May 3, 2022

I'm adding that line and seems to work. Could you tell me which problem was introduced? Because I'd like to know if i have a bug and haven't noticed. thanks!

In the old version, it will crashed so I can't add this patch to lib.

U can try with reanimated@2.3.x

@dohooo
Copy link
Owner

dohooo commented May 4, 2022

I'm adding that line and seems to work. Could you tell me which problem was introduced? Because I'd like to know if i have a bug and haven't noticed. thanks!

It will crash when I add it. react-native-reanimated@2.3.1
image

Although there are no problems with the new version of react-native-reanimated@2.7.0+

@dohooo dohooo changed the title Crash when updating to react-native-reanimated 2.7.0 Crash when updating to react-native-reanimated 2.7.0 ( undefined is not a function ) May 4, 2022
@Zubair199
Copy link

https://discord.gg/Ge8bZbpG Come here for the latest news.

can you send a new invite link for discord as this has expired , thanks in advance

@dohooo
Copy link
Owner

dohooo commented May 5, 2022

https://discord.gg/Ge8bZbpG Come here for the latest news.

can you send a new invite link for discord as this has expired , thanks in advance

https://discord.gg/KsXRuDs43y

@dohooo
Copy link
Owner

dohooo commented May 15, 2022

Are there any help with this line?

global.__reanimatedWorkletInit = () => {};

@dohooo dohooo added the needs review The issue has been solved, Wait for confirmation. label May 15, 2022
@Harvinder5
Copy link

this issue is still haunting me
my release is stuck because of this

@UchennaOkafor
Copy link

@Harvinder5

Downgrade to reanimated 2.6.0

@Harvinder5
Copy link

still not working
i think there is no going back
I tried downgrading even further but all goes in vain

@diego-paired
Copy link

We have managed to get it working with Reanimated 2.8.0 by adding this line to our code:
global.__reanimatedWorkletInit = () => {}; before AppRegistry.registerComponent

@3KINGZ
Copy link

3KINGZ commented May 25, 2022

global.__reanimatedWorkletInit = () => {};

i still got the error after trying this

@beetlebum
Copy link

with

    "react-native-reanimated": "^2.8.0",
    "react-native-reanimated-carousel": "^2.3.11",

and

global.__reanimatedWorkletInit = () => {};

AppRegistry.registerComponent(appName, () => Root);

it works for us

@pweisensee
Copy link

@dohooo this is a big issue for modern react native and Expo 45+ apps. Can you release a react-native-reanimated-carousel@3.0.0 with this breaking change for use with react-native-reanimated@2.7.0+?

@dohooo dohooo closed this as completed in 591f0d8 Jun 4, 2022
@dohooo
Copy link
Owner

dohooo commented Jun 4, 2022

I released it in 2.6.0.

This error is triggered by this PR, And there is related issue.

In version 2.7.0+, __reanimatedWorkletInit is deleted, so i added this code to my index file.

+ if (!('__reanimatedWorkletInit' in global)) {
+     Object.assign(global, { __reanimatedWorkletInit: () => {} });
+ }

export type { TCarouselProps, ICarouselInstance } from './types';
import Carousel from './Carousel';

export default Carousel;

I think this should work with different versions of reanimated. And this problem has been happening for too long. Sorry. I will reopen this issue if there is any problem. 🍺

@Mohamed-kassim
Copy link

It still not working for me with expo ,45 and rnn 2.8.0
@dohooo
@pweisensee worked for u?

@dohooo
Copy link
Owner

dohooo commented Jun 8, 2022

It still not working for me with expo ,45 and rnn 2.8.0
@dohooo
@pweisensee worked for u?

Can you give a reproduce to me?

@Mohamed-kassim
Copy link

Okay let me try, and I will get back to you

@pweisensee
Copy link

Version 2.6.0 of this library did not fix my Expo SDK 45 issue either, even after aggressively cleaning build cache.

I have not been able to isolate the issue yet. Reverted my project to SDK 44 for now. ☹️

@pweisensee
Copy link

For me it seems to come from this library still though, here is a more helpful error message from what I'm experiencing.
Screenshot_20220603-162741_Mangamo

@Mohamed-kassim
Copy link

@dohooo I have the same error, the 6 trace step I think
useCarouselcontroller

@Mohamed-kassim
Copy link

@dohooo
https://snack.expo.dev/@mohamed-kassim/carousel-issue
this is a snack with basic example
just change between expo45 and expo 44
to change the reanimated version to 2.8.0 and 2.3.0
expo 45 and reanimated 2.8.0 not working with error
Screen Shot 2022-06-08 at 2 20 41 PM
and this is the error on real device

@dohooo dohooo reopened this Jun 9, 2022
@dohooo dohooo closed this as completed in a326f8c Jun 10, 2022
@dohooo
Copy link
Owner

dohooo commented Jun 10, 2022

It's fixed in v3.0.0 🫠

image

I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE,I PROMISE

@quicksilverr
Copy link

I don't get the error message, my app simply crashes.

I installed the new version and I am using "react-native-reanimated": "^2.6.0"

@quicksilverr
Copy link

quicksilverr commented Jun 16, 2022

Only react-native-reanimated@2.7.0 works, no other version is supported. This is my understanding, I may be wrong, as all other versions it was crashing.

@Augustineugbaja
Copy link

My expo app crashes still even with the react-native-reanimated@2.7.0 and the newest versions also

@avedetvedea
Copy link

@dohooo @Augustineugbaja Expo Go App as well as simulators crash upon opening with the latest version. I came from the previous unmaintained library but immediately got hit by this and unable to use it. What should I be doing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed needs review The issue has been solved, Wait for confirmation. P1
Projects
None yet
Development

No branches or pull requests