Angular --prod构建成功但UI不显示

时间:2017-09-27 20:00:44

标签: angular angular-cli

使用angular-cli 1.3.1 / Angular 4.3.5

非常感谢对此问题的深入了解。

Angular dev build成功并显示没有问题。 Angular prod构建成功但由于此错误而无法显示。

vendor.4b0119a81d0c1aee597c.bundle.js:1 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
    at vendor.4b0119a81d0c1aee597c.bundle.js:1
    at Array.forEach (<anonymous>)
    at t.visitTrigger (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at S (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at t.build (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at j (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at e.t.registerTrigger (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at vendor.4b0119a81d0c1aee597c.bundle.js:1
    at Array.forEach (<anonymous>)
    at t.createRenderer (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at vendor.4b0119a81d0c1aee597c.bundle.js:1
    at Array.forEach (<anonymous>)
    at t.visitTrigger (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at S (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at t.build (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at j (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at e.t.registerTrigger (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at vendor.4b0119a81d0c1aee597c.bundle.js:1
    at Array.forEach (<anonymous>)
    at t.createRenderer (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at s (polyfills.4e7a82003010f988c738.bundle.js:1)
    at s (polyfills.4e7a82003010f988c738.bundle.js:1)
    at polyfills.4e7a82003010f988c738.bundle.js:1
    at t.invokeTask (polyfills.4e7a82003010f988c738.bundle.js:1)
    at Object.onInvokeTask (vendor.4b0119a81d0c1aee597c.bundle.js:1)
    at t.invokeTask (polyfills.4e7a82003010f988c738.bundle.js:1)
    at r.runTask (polyfills.4e7a82003010f988c738.bundle.js:1)
    at i (polyfills.4e7a82003010f988c738.bundle.js:1)
    at <anonymous>
b @ vendor.4b0119a81d0c1aee597c.bundle.js:1

错误发生在以下来源

        t.prototype.visitTrigger = function(t, e) {
            var n = this
              , r = e.queryCount = 0
              , o = e.depCount = 0
              , i = []
              , a = [];
            t.definitions.forEach(function(t) {
                if (n._resetContextStyleTimingState(e),
                0 == t.type) {
                    var s = t
                      , l = s.name;
                    l.split(/\s*,\s*/).forEach(function(t) {
                        s.name = t,
                        i.push(n.visitState(s, e))
                    }),
                    s.name = l
                } else if (1 == t.type) {
                    var u = n.visitTransition(t, e);
                    r += u.queryCount,
                    o += u.depCount,
                    a.push(u)
                } else
                    e.errors.push("only state() and transition() definitions can sit inside of a trigger()")
            });
            var s = new Dt(t.name,i,a);
            return s.options = L(t.options),
            s.queryCount = r,
            s.depCount = o,
            s
        }

0 个答案:

没有答案