首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >构建JS包的世博会启动错误:在HMRClient.js中进行类型转换

构建JS包的世博会启动错误:在HMRClient.js中进行类型转换
EN

Stack Overflow用户
提问于 2021-02-08 12:27:20
回答 1查看 157关注 0票数 1

发行:

我最近在我的世博项目中遇到了一个阻塞问题()。

类型强制转换表达式需要用括号包装

我检查了我的代码,没有注意到会导致这个问题的任何更改。

当我键入使用MetroBundler启动世博建筑(shell)的指令时,它总是会抛出一个错误。

  1. expo start

  1. Expo DevTools is running at http://localhost:19002 Opening DevTools in the browser... (press shift-d to disable) Starting Metro Bundler

  1. ERROR :

代码语言:javascript
复制
Failed building JavaScript bundle.
SyntaxError: C:\xamppN\htdocs\mobile-new\node_modules\react-native\Libraries\Utilities\HMRClient.js: The type cast expression is expected to be wrapped with parenthesis (284:31)

  282 | function flushEarlyLogs(client) {
  283 |   try {
> 284 |     pendingLogs.forEach(([level: LogLevel, data: Array<mixed>]) => {
      |                                ^
  285 |       HMRClient.log(level, data);
  286 |     });
  287 |   } finally {

类型强制转换表达式需要用括号包装

我试过:

编辑目标文件的later.

  • Deleting

  • 文件,它在节点模块内,如果我不得不安装worked

  • Updating all node_modules和重新安装没有worked

  • Updating的node_modules到最后版本,没有更改任何东西,同样的错误

也不是很有效。

更多信息:

package.json:

代码语言:javascript
复制
 "dependencies": {
    "antd": "^3.23.2",
    "expo": "^39.0.0", 
    "expo-asset": "~8.2.0",
    "expo-av": "~8.6.0",
    "expo-barcode-scanner": "~9.0.0",
    "expo-cli": "^3.27.14",
    "expo-constants": "~9.2.0",
    "expo-localization": "~9.0.0",
    "expo-permissions": "~9.3.0",
    "expo-secure-store": "~9.2.0",
    "expo-updates": "~0.3.3",
    "expokit": "31.0.2",
    "moment": "^2.22.2",
    "node-forge": "^0.10.0",
    "npm": "^6.14.8",
    "react": "16.13.1",
    "react-datetime-inputs": "^0.0.6",
    "react-mixin": "^2.0.2",
    "react-native": "https://github.com/expo/react-native/archive/sdk-39.0.0.tar.gz",
    "react-native-create-bridge": "^2.0.1",
    "react-native-dialog": "^5.6.0",
    "react-native-dialog-input": "^1.0.7",
    "react-native-gesture-handler": "~1.7.0",
    "react-native-imei": "^0.1.2",
    "react-native-modal-datetime-picker": "^7.5.0",
    "react-native-pay-password": "^0.0.2",
    "react-native-reanimated": "~1.13.0",
    "react-native-sentry": "^0.43.2",
    "react-native-sha1": "^1.2.3",
    "react-navigation": "^4.0.6",
    "react-navigation-drawer": "^2.2.2",
    "react-select": "^3.0.4",
    "react-timer-mixin": "^0.13.4",
    "sentry-expo": "~2.0.0",
    "yarn": "^1.16.0"
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-27 11:22:11

这是"yarn": "^1.16.0" and "npm": "^6.14.8"之间的冲突。

您应该选择ONE包管理器,并避免交叉依赖。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66101629

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档