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

[3.16.2] sv.addListener is not a function (it is Object), js engine: reanimated #6741

Open
mgcrea opened this issue Nov 21, 2024 · 0 comments
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@mgcrea
Copy link

mgcrea commented Nov 21, 2024

Description

I'm encountering issues on basic drag&drop code that used to work well in previous versions of the library, with a js crash when calling setCount in the following snippet (full file):

  const [count, setCount] = useState(0);
  
  const onDragEnd = () => {
    setCount(count => count + 1);
  };

  const handleDragEnd: DndProviderProps['onDragEnd'] = ({active, over}) => {
    'worklet';
    if (over) {
      console.log(`Current count is ${count}`);
      runOnJS(onDragEnd)();
    }
  };

That throws the following error:

console.js:589 ReanimatedError: sv.addListener is not a function (it is Object), js engine: reanimated
anonymous @ console.js:589
reactConsoleErrorHandler @ ExceptionsManager.js:168
anonymous @ setUpDeveloperTools.js:67
registerError @ LogBox.js:198
anonymous @ LogBox.js:68
overrideMethod @ backend.js:14284
reportException @ ExceptionsManager.js:110
handleException @ ExceptionsManager.js:158
handleError @ setUpErrorHandling.js:24
reportFatalError @ error-guard.js:49
reportFatalErrorOnJS @ errors.ts:93

Last version where it was tested to work was ~3.6, started crashing with ~3.7. Any ideas?

Steps to reproduce

  1. clone https://github.com/mgcrea/react-native-dnd-expo-example
  2. npm run dev
  3. drag the "drag" box on the "drop" box
  4. crash

When using expo the crash is native while it is properly caught JS-side when using a local native app.

Snack or a link to a repository

https://snack.expo.dev/@mgcrea/mad-orange-stroopwafels
https://github.com/mgcrea/react-native-dnd-expo-example

Reanimated version

3.7.x -> 3.16.2

React Native version

0.76.2

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

None

Build type

None

Device

iOS simulator

Device model

iPhone 16

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 Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

1 participant