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

Unable to make a working Snack with Expo >= 45 #291

Closed
jb-5murf opened this issue Oct 26, 2022 · 10 comments
Closed

Unable to make a working Snack with Expo >= 45 #291

jb-5murf opened this issue Oct 26, 2022 · 10 comments
Assignees
Labels
bug Something isn't working needs review The issue has been solved, Wait for confirmation. P1

Comments

@jb-5murf
Copy link

jb-5murf commented Oct 26, 2022

Describe the bug
After updating from 3.1.0 to 3.1.1 I get error 'Attempting to define property on object that is not extensible'. I tried to make a Snack to reproduce and investigate this error, but I'm not able to run even a minimal example - I get error 'a.g.__reanimatedWorkletInit is not a function. (In 'a.g.__reanimatedWorkletInit(n)', 'a.g.__reanimatedWorkletInit' is undefined)'. After switching Expo from 46 to 44 this Snack works.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://snack.expo.dev/@jb5/9c5aee
  2. Run on Android or iOS
  3. See error
  4. Switch Expo to 44
  5. Snack works

Expected behavior
No 'a.g.__reanimatedWorkletInit is not a function. (In 'a.g.__reanimatedWorkletInit(n)', 'a.g.__reanimatedWorkletInit' is undefined)' error in Expo >= 45

Versions (please complete the following information):

  • expo: 46.0.0
  • react: 18.0.0
  • react-native: 0.69.5
  • react-native-reanimated: ~2.9.1
  • react-native-reanimated-carousel: ^3.1.1
  • react-native-gesture-handler: ~2.5.0
@jb-5murf jb-5murf added the bug Something isn't working label Oct 26, 2022
@dohooo dohooo added the P1 label Oct 26, 2022 — with Volta.net
@unixvb
Copy link

unixvb commented Oct 27, 2022

The same with react native CLI, after updating from 3.1.0 to 3.1.1 getting same error

@mym0404
Copy link

mym0404 commented Oct 31, 2022

I suffer the same issue after bumping 3.0.3 -> 3.1.3

With a revert, the issue has been resolved.

This is the reanimated issue but not a bug.

It seems the usage of reanimated in this library is implemented in a slightly wrong way.

related issue

@dohooo
Copy link
Owner

dohooo commented Nov 1, 2022

How can I reproduce this problem locally?

@mym0404
Copy link

mym0404 commented Nov 1, 2022

@dohooo I can't sure except it happens only 3.1.3 not 3.0.3

This is my code about that

I can't expect what is problem but I used these props.

<Carousel
                style={{ flex: 1 }}
                data={groups}
                renderItem={/* not related, crash even return null */}
                width={screenWidth}
                windowSize={3}
                onSnapToItem={index => setSelectedGroup(groups[index])}
                mode={'parallax'}
                modeConfig={{
                  parallaxScrollingScale: 1,
                  parallaxScrollingOffset: 23,
                }}
                loop={false}
              />

@dohooo
Copy link
Owner

dohooo commented Nov 1, 2022

Sorry, I've been working all day. I am really busy. It's a little tiring for me to maintain this project right now. 😞
Released in 3.1.2, and tell me the result, please. thx

@dohooo dohooo added the needs review The issue has been solved, Wait for confirmation. label Nov 1, 2022
@dohooo dohooo closed this as completed in b49715c Nov 1, 2022
@jb-5murf
Copy link
Author

jb-5murf commented Nov 2, 2022

Hi, I'm still getting the same errors in 3.1.3. I think it's the same problem described in #298

@dohooo
Copy link
Owner

dohooo commented Nov 2, 2022

Hi, I'm still getting the same errors in 3.1.3. I think it's the same problem described in #298

Can you provide a repo that can reproduce this problem?

@dohooo dohooo reopened this Nov 2, 2022
@jb-5murf
Copy link
Author

jb-5murf commented Nov 2, 2022

// THIS WORKS IN ALL VERSIONS

import React from 'react';
import { View, Dimensions } from 'react-native';
import Carousel from 'react-native-reanimated-carousel';

const colors = ['red', 'orange', 'yellow', 'lime', 'cyan', 'blue', 'purple'];

export default function App() {
    return (
        <Carousel
            data={colors}
            renderItem={({ item }) => <View style={{ flex: 1, backgroundColor: item }} />}
            width={Dimensions.get('window').width}
        />
    );
}
// THIS WORKS ONLY IN react-native-reanimated-carousel <= 3.1.0

import React from 'react';
import { View, Dimensions } from 'react-native';
import Carousel from 'react-native-reanimated-carousel';

const colors = [
  <View style={{ flex: 1, backgroundColor: 'red' }} />,
  <View style={{ flex: 1, backgroundColor: 'orange' }} />,
  <View style={{ flex: 1, backgroundColor: 'yellow' }} />,
  <View style={{ flex: 1, backgroundColor: 'lime' }} />,
  <View style={{ flex: 1, backgroundColor: 'cyan' }} />,
  <View style={{ flex: 1, backgroundColor: 'blue' }} />,
  <View style={{ flex: 1, backgroundColor: 'purple' }} />,
];

export default function App() {
  return (
      <Carousel
          data={colors}
          renderItem={({ item }) => item}
          width={Dimensions.get('window').width}
      />
  );
}

@dohooo dohooo closed this as completed in 7a82994 Nov 4, 2022
@dohooo
Copy link
Owner

dohooo commented Nov 4, 2022

3.1.5

@jb-5murf
Copy link
Author

jb-5murf commented Nov 4, 2022

It works 👍

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

No branches or pull requests

4 participants