首页 > 解决方案 > 当错误消息不显示位置时查找错误

问题描述

我正在使用 Ionic、Angular 和 Firebase 构建应用程序。

我遇到了一个问题,代码是由 webpack 构建和打包的,它从 中返回一个错误polyfills.js,这一点用处都没有……

错误消息如下所示:

Unhandled Promise rejection: Missing Command Error ; Zone: <root> ; Task:
Promise.then ; Value: Missing Command Error undefined

在此处输入图像描述

该错误每 30 秒发生一次。

错误的非缩小版本如下所示:

function l(t) {
    var e = t.prototype,
        n = e.then;
    e[d] = n;
    var r = Object.getOwnPropertyDescriptor(t.prototype, "then");
    r && !1 === r.writable && r.configurable && Object.defineProperty(t.prototype, "then", {
            writable: !0
        }),
        t.prototype.then = function(t, e) {
            var r = this;
            return new x(function(t, e) {
                n.call(r, t, e)
            }).then(t, e)
        },
        t[R] = !0
}
var h = n.symbol,
    p = [],
    v = h("Promise"),
    d = h("then");
n.onUnhandledError = function(t) {
        if (n.showUncaughtError()) {
            var e = t && t.rejection;
            e ? console.error("Unhandled Promise rejection:", e instanceof Error ? e.message : e, "; Zone:", t.zone.name, "; Task:", t.task && t.task.source, "; Value:", e, e instanceof Error ? e.stack : void 0) : console.error(t)
        }
    },
    n.microtaskDrainDone = function() {
        for (; p.length;)
            for (; p.length;)
                ! function() {
                    var t = p.shift();
                    try {
                        t.zone.runGuarded(function() {
                            throw t
                        })
                    } catch (t) {
                        r(t)
                    }
                }()
    };

知道如何调试吗?谢谢!

标签: javascriptangulardebuggingwebpackzone.js

解决方案


推荐阅读