reactjs - React native:无法加载捆绑意外的超类
问题描述
每当我运行 IOS 模拟器时,它总是给我这个错误!这是为什么?
error: bundling failed: SyntaxError: .../node_modules/react-native/Libraries/Blob/FileReader.js: Unexpected super class type: CallExpression
35 | const DONE = 2;
36 |
> 37 | class FileReader extends EventTarget(...READER_EVENTS) {
| ^
38 | static EMPTY = EMPTY;
39 | static LOADING = LOADING;
40 | static DONE = DONE;
at File.buildCodeFrameError
解决方案
之前遇到过这个问题,我已经过时了,安装react-native
和升级你的项目,它应该可以工作。react-native-cli
react-native-git-upgrade
同时运行以下命令:
watchman watch-del-all &&
rm -rf $TMPDIR/react-native-packager-cache-* &&
rm -rf $TMPDIR/metro-bundler-cache-* &&
rm -rf node_modules/ &&
yarn cache clean &&
yarn install &&
yarn start -- --reset-cache
推荐阅读
- reactjs - 在服务器上的 Docker 容器中创建 React 和 Laravel 之间的内部连接
- artifactory - 卸载 XRay 评估后包视图中的 Artifactory 服务器错误 500
- database - Oracle (v18/19) 实体化视图上的触发器不知道旧值
- c# - 将 SQL 查询转换为 LINQ Lambda C#
- visual-studio - 在代码编辑器中显示错误的 Visual Studio 2019 扩展
- sql-server - Bitnami Redmine 无法连接:Adaptive Server
- python - 如何从 JSON 格式中获取价值
- python - Python字典不允许相互减去值(不是键,值)
- spring-boot - 如何以编程方式检测营销和基于角色的电子邮件?
- mysql - 我应该如何在配置单元查询中获取具有特定键的“map”列 - Impala SQL