未处理的承诺拒绝:((window | global).Promise`已被覆盖 [英] Unhandled Promise rejection: `(window|global).Promise` has been overwritten

查看:87
本文介绍了未处理的承诺拒绝:((window | global).Promise`已被覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 polyfills.ts 文件包含:

import 'core-js/es6';
import 'core-js/es7/reflect';
require('zone.js/dist/zone');

现在,我经常(但并非总是)遇到此错误:

Now I am frequently (but not always) getting thiserror:

未处理的承诺拒绝:Zone.js检测到ZoneAwarePromise (窗口|全局).Promise 已被覆盖.最可能的原因是在Zone.js之后加载了Promise polyfill(在加载zone.js时无需填充Promise api.

Unhandled Promise rejection: Zone.js has detected that ZoneAwarePromise (window|global).Promise has been overwritten. Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded.

我该如何解决?

推荐答案

this issue have been fixed by https://github.com/angular/zone.js/pull/899, in the next version of zone.js(0.8.19), the error will gone.

这篇关于未处理的承诺拒绝:((window | global).Promise`已被覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆