node.js - TypeError: _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_17___default.a.allSettled 不是函数
问题描述
我正在尝试在我的反应项目中使用 Promise.allSettled,如下所示。我想解决所有承诺,即使其中一个失败。
出现以下错误:
TypeError: _babel_runtime_corejs2_core_js_promise__WEBPACK_IMPORTED_MODULE_17___default.a.allSettled is not a function
我的代码:
const promises = [
getConvWithTextAndMatchWordsForCardForStoryOrOpptyP(bigNameCallOptions),
getHeuristicScoreDetailsForCardAndStory(heuristicsPayload),
];
if (params.cardId > 0) {
promises.push(getPlaybookCardDetails(params.cardId));
}
Promise.allSettled(promises).then( rest of the code... )
我的依赖项如下
"node": v14.17.4,
"webpack": "^4.20.2",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/polyfill": "^7.0.0"
不知道为什么我会遇到这个问题。先感谢您。
解决方案
推荐阅读
- python - Bash脚本到Python不知道如何
- java - 单击android上的手机硬件后退按钮时从未调用过onResume?
- python - 使用 PyQt5 提取网页的某些部分并显示它们
- javascript - Firebase 数据库数据检索遇到问题
- reactjs - React:componentDidUpdate - 当我更新数组中的对象时,以前的状态与当前状态相同
- drupal - Drupal JSON:API 核心模块。无法使用授权
- javascript - Javascript根据另一个元素提取数组中的元素
- r - R: data.table 同时对多个数据集进行子集化
- ios - 以编程方式放大 UIScrollview 不起作用
- python-3.x - 无法让我的函数返回正确的布尔值