Expo SDK を 43 から 44 にアップグレードしたら Reanimated 周りでエラー
April 05, 2022
エラー内容
Error: Requiring module "node_modules/react-native-reanimated/src/Animated.js", which threw an exception: Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?
解決方法
babel.config.js
に reanimated
のプラグインを追加
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
+ plugins: ['react-native-reanimated/plugin'],
};
};
https://docs.expo.dev/versions/latest/sdk/reanimated/