ERROR Error: Reanimated 2 failed to create a worklet
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ERROR Error: Reanimated 2 failed to create a worklet相关的知识,希望对你有一定的参考价值。
参考技术A ERROR Error: Reanimated 2 failed to create a worklethttps://blog.csdn.net/lxyoucan/article/details/121851577
先试一下清空缓存命令
yarn start --reset-cache
npx react-native start --reset-cache
Unknown option: .plugin. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.
修改修改配置文件babel.config.js并增加
plugins: ['react-native-reanimated/plugin'],
请注意Windows需要带引号
"plugin":['react-native-reanimated/plugin'],
显示为:
module.exports =
presets: ['module:metro-react-native-babel-preset'],
"plugins": ['react-native-reanimated/plugin'],
;
Mac电脑可以直接写成
plugins: ['react-native-reanimated/plugin'],
显示为:
module.exports =
presets: ['module:metro-react-native-babel-preset'],
plugins: ['react-native-reanimated/plugin'],
安装 Reanimated 2 后仍会收到警告“如果您想使用 Reanimated 2 那么...”
【中文标题】安装 Reanimated 2 后仍会收到警告“如果您想使用 Reanimated 2 那么...”【英文标题】:After installin Reanimated 2 still get the warrning "If you want to use Reanimated 2 then..." 【发布时间】:2021-09-26 05:49:05 【问题描述】:我正在尝试使用“@react-navigation/top-tabs”,但它依赖于 reanimated 2 我安装了 reanimated 2 但仍然收到相同的警告:
If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation
1-可以忽略警告,使用:
.ignoreLogs(['Reanimated 2']);
2-如果你有任何其他想法,请帮助我
谢谢
【问题讨论】:
查看此链接github.com/PedroBern/react-native-collapsible-tab-view/issues/… @Majidlotfinia 谢谢你,但仍然有同样的问题,问题已关闭......该链接没有解决方案 【参考方案1】:安装后您可能会收到与对等依赖项相关的警告。它们通常是由某些包中指定的不正确版本范围引起的。只要您的应用在构建,您就可以放心地忽略大多数警告。
【讨论】:
如何接受这个答案。 来自@Kelly 文档 link以上是关于ERROR Error: Reanimated 2 failed to create a worklet的主要内容,如果未能解决你的问题,请参考以下文章
错误:错误:无法从 /node_modules/react-native-reanimated/src/reanimated2/index.ts 解析模块./Hooks
安装 Reanimated 2 后仍会收到警告“如果您想使用 Reanimated 2 那么...”
Reanimated 2创建worklet失败,可能你忘了添加Reanimated的babel插件?,js引擎:hermes
Reanimated 2创建worklet失败,可能是你忘记添加Reanimated的babel插件了?