wix / react-native-ui-lib

UI Components Library for React Native

Home Page:https://wix.github.io/react-native-ui-lib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expo 49 - Error: Failed to create a worklet.

ddennis opened this issue · comments

Description

Trying to move our app to Expo 49.
Getting this as soon as i add a Button. Works fine with a View.

Because of Expo i am not able to upgrade react-native-reanimated higher than 3.3.0

Any help would be highly appreciated 👍

I have also seen this software-mansion/react-native-reanimated#4511

Error: Failed to create a worklet. Did you forget to add Reanimated Babel plugin in babel.config.js? See installation docs at https://docs.swmansion.com/react-native-reanimated/d
ocs/fundamentals/installation#babel-plugin., js engine: hermes

babel.config.js

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      // Required for expo-router
      'expo-router/babel',
      'react-native-reanimated/plugin',
    ],
  };
};

{
  "name": "expo-tester-49",
  "main": "expo-router/entry",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "test": "jest --watchAll"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "^13.0.0",
    "@react-navigation/native": "^6.0.2",
    "babel-plugin-module-resolver": "^5.0.0",
    "expo": "^49.0.9",
    "expo-font": "~11.4.0",
    "expo-linking": "~5.0.2",
    "expo-router": "2.0.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "expo-system-ui": "~2.4.0",
    "expo-web-browser": "~12.3.2",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.4",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-reanimated": "^3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-ui-lib": "^7.8.0",
    "react-native-web": "~0.19.6"
  },
  "expo": {
    "install": {
      "exclude": [
        "react-native-reanimated"
      ]
    }
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~18.2.14",
    "jest": "^29.2.1",
    "jest-expo": "~49.0.0",
    "react-test-renderer": "18.2.0",
    "typescript": "^5.1.3"
  },
  "overrides": {
    "react-refresh": "~0.14.0"
  },
  "resolutions": {
    "react-refresh": "~0.14.0"
  },
  "private": true
}

Related to

  • [x ] Components
  • Demo
  • Docs
  • Typings

Steps to reproduce

Add a Button component to a view
Button label="What"></Button>

Expected behavior

That the button renders

Actual behavior

 Error: Failed to create a worklet. Did you forget to add Reanimated Babel plugin in babel.config.js? See installation docs at https://docs.swmansion.com/react-native-reanimated/d
ocs/fundamentals/installation#babel-plugin., js engine: hermes

  • React Native version: 0.72.4
  • React Native UI Lib version: ^7.8.0

Affected platforms

  • Android
  • iOS
  • Web

Any updates on this issue @ddennis ?

@GoldAndLink sorry no. I moved to using nativewind since I was not able to get the latest version of Expo working.

@ddennis @GoldAndLink

It's probably a caching issue - after adding reanimated, just run npx expo start -c and it should start working as expected.

Tested working on Expo 49.0.16 with expo-router 2.0.9.

@biztems, thank you, you saved the day:

npx expo start -c