如何修复 - 未处理的拒绝 (TypeError)。 Promise.allSettled 不是函数
How to fix - Unhandled Rejection (TypeError). Promise.allSettled is not a function
Photo
Photo
我在测试移动功能时只在某些 phone 上遇到这些错误。如果有人知道如何修复它...我的节点版本是 14.10.0,据我所知可能来自那里,因为 Promise.allSettled 是在 12.9 版以上处理的。当我查看node --version 时,它是14.10.0,但我的nodejs --version 是10.19.0。 phone 是 android 版本 8 的三星 A3。在华为 Y5 android 版本 9 上,没有任何错误,在任何 iPhone 上也没有错误,我已经检查过了远.
allSettled
is quite a new addition to Promise
, so you're just dealing with slightly out-of-date environments. You'll need to polyfill it in the environments where it doesn't exist. Your best bet is to locate a well-maintained polyfill library and use that. (One library is core.js
。该项目发起人的可用性有一些戏剧性,但我认为现在已经基本解决了。)
Photo Photo
我在测试移动功能时只在某些 phone 上遇到这些错误。如果有人知道如何修复它...我的节点版本是 14.10.0,据我所知可能来自那里,因为 Promise.allSettled 是在 12.9 版以上处理的。当我查看node --version 时,它是14.10.0,但我的nodejs --version 是10.19.0。 phone 是 android 版本 8 的三星 A3。在华为 Y5 android 版本 9 上,没有任何错误,在任何 iPhone 上也没有错误,我已经检查过了远.
allSettled
is quite a new addition to Promise
, so you're just dealing with slightly out-of-date environments. You'll need to polyfill it in the environments where it doesn't exist. Your best bet is to locate a well-maintained polyfill library and use that. (One library is core.js
。该项目发起人的可用性有一些戏剧性,但我认为现在已经基本解决了。)