不变违规:模块“AppRegistry”不是已注册的可调用模块(调用“runApplication”)。等等
Invariant Violation: Module `AppRegistry` is not a registered callable module (calling `runApplication`). and etc
我正在使用 react-native
制作一个项目,当我添加抽屉导航时它开始给我一个错误:
Invariant Violation: Module AppRegistry
is not a registered callable module (calling runApplication
). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js
engine: hermes
所以当我搜索解决方案时,我遇到了这个答案 https://github.com/software-mansion/react-native-reanimated/issues/846#issuecomment-943267584 - 但是当我按照此 link 中给出的过程进行操作时,它开始给我两个错误 - 报错:Reanimated 2 创建worklet失败,可能是你忘记添加Reanimated的babel插件了?,js engine: hermes 还有上面的错误。我正在使用 react-native 0.67。如果可以请帮忙
尝试在您的 babel.config.js 文件中添加这一行;然后再运行,也许对你有帮助
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
"react-native-reanimated/plugin"
]
};
我正在使用 react-native
制作一个项目,当我添加抽屉导航时它开始给我一个错误:
Invariant Violation: Module
AppRegistry
is not a registered callable module (callingrunApplication
). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.,js
engine:hermes
所以当我搜索解决方案时,我遇到了这个答案 https://github.com/software-mansion/react-native-reanimated/issues/846#issuecomment-943267584 - 但是当我按照此 link 中给出的过程进行操作时,它开始给我两个错误 - 报错:Reanimated 2 创建worklet失败,可能是你忘记添加Reanimated的babel插件了?,js engine: hermes 还有上面的错误。我正在使用 react-native 0.67。如果可以请帮忙
尝试在您的 babel.config.js 文件中添加这一行;然后再运行,也许对你有帮助
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
"react-native-reanimated/plugin"
]
};