react-native-reanimated: React Native Debugger - ERROR - TurboModuleRegistry.getEnforcing(...): 'NativeReanimated'

Description

Running a basic example in an Expo client while running React Native Debugger on port 19000. Getting the following error:

Invariant Violation ExceptionsManager.js:179 TurboModuleRegistry.getEnforcing(…): ‘NativeReanimated’ could not be found. Verify that a module by this name is registered in the native binary.

Screenshots

image

Steps To Reproduce

Expected behavior

No errors

Actual behavior

Error (see above)

Snack or minimal code example

import Animated, {
  useSharedValue,
  withTiming,
  useAnimatedStyle,
  Easing,
} from "react-native-reanimated";
import { View, Button } from "react-native";
import React from "react";

export default function AnimatedStyleUpdateExample(props) {
  const randomWidth = useSharedValue(10);

  const config = {
    duration: 500,
    easing: Easing.bezier(0.5, 0.01, 0, 1),
  };

  const style = useAnimatedStyle(() => {
    return {
      width: withTiming(randomWidth.value, config),
    };
  });

  return (
    <View>
      <Animated.View
        style={[
          { width: 100, height: 80, backgroundColor: "black", margin: 30 },
          style,
        ]}
      />
      <Button
        title="toggle"
        onPress={() => {
          randomWidth.value = Math.random() * 350;
        }}
      />
    </View>
  );
}

Package versions

{
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.13.3",
    "expo": "~40.0.0",
    "expo-status-bar": "~1.0.3",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
    "react-native-reanimated": "2.0.0-rc.0",
    "react-native-web": "~0.13.12"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0",
    "babel-preset-expo": "8.3.0"
  },
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo web",
    "eject": "expo eject"
  },
  "private": true
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 9
  • Comments: 21 (5 by maintainers)

Most upvoted comments

What does “use flipper to debug” even mean? Flipper doesn’t have a way to connect to a debug port to set breakpoints. You still can’t do performance profiling. If “debug” just means see “console.log” statements thats a poor statement of debugging, I can see that in the terminal now. What does flipper even give you?

Have you tried using Flipper for debugging? Remote debugging in Chrome works by running JS code in Chrome’s V8 and connecting to the Bridge. We use Turbomodules (which don’t use Bridge at all) so Chrome can’t connect with the native side – this error is expected but could be described better. AFAIK Flipper should work with Android without problems on any recent RN version and iOS should work after RN 0.64.

EDIT: Seems like Flipper doesn’t work with Expo yet. If you need a debugger functionality you probably should wait with the Reanimated upgrade.

The same error on react native cli project. react native reanimated 2.0.0. It doesn’t matter device/emulator and Hermes on/off. Android version only checked. When I downgrade react native reanimated to 1.13.2 the error disappear.