wcandillon / can-it-be-done-in-react-native

⚛️ 📺 Projects from the “Can it be done in React Native?” YouTube series
https://www.youtube.com/wcandillon
MIT License
4.05k stars 1.3k forks source link

Reanimated failed to create a worklet issue (still) #166

Open joshuaaron opened 2 years ago

joshuaaron commented 2 years ago

I've been through this thread but unable to find a working solution so hoping someone might also be able to help here?

Cannot build our current app with reanimated due to the 'Reanimated failed to create a worklet, maybe you forgot to add Reanimated's babel plugin' error

I've followed these instructions, as well as the linked issue threads suggestions on clearing caches.

Note this is for react-native cli project, not expo. This is becoming a dealbreaker and hoping someone here has found a solution?

"react-native": "0.66.0",
"react-native-reanimated": "2.3.0-beta.3"
"react-native-gesture-handler": "1.10.3",
"react-native-flipper": "0.115.0",

babel.config.js

const presets = ['module:metro-react-native-babel-preset'];
const plugins = [];

plugins.push([
    require.resolve('babel-plugin-module-resolver'),
    {
        cwd: 'babelrc',
        root: ['./src'],
        extensions: ['.ios.ts', '.android.ts', '.ts', '.ios.tsx', '.android.tsx', '.tsx', '.jsx', '.js', '.json'],
        alias: {
            '@ch': './src',
        },
    },
    'react-native-reanimated/plugin',
]);

module.exports = {
    presets,
    plugins,
};
watchman watch-del-all 
&& rm -rf node_modules/ && rm package-lock.json 
&& npm cache clean --force 
&& npm install 
&& npx react-native start -- --reset-cache
Screen Shot 2021-11-12 at 9 18 57 AM
wcandillon commented 2 years ago

I'm not familiar with this issue at all. Could you share a small repo to reproduce the issue? I'm using expo exclusively so it might be hard for me to help here.