如何获得比 "line 4308490384 of bundle.js" 更有意义的堆栈跟踪?

How to get a more meaningful stack trace than "line 4308490384 of bundle.js"?

我正在处理一个非常纠结的 Angular 4.4 应用程序。它爆炸了,这是我得到的堆栈跟踪:

ERROR Error: "[object Object]"
    resolvePromise http://localhost:4300/polyfills.bundle.js:7118
    resolvePromise http://localhost:4300/polyfills.bundle.js:7075
    scheduleResolveOrReject http://localhost:4300/polyfills.bundle.js:7179
    invokeTask http://localhost:4300/polyfills.bundle.js:6710
    onInvokeTask http://localhost:4300/vendor.bundle.js:370092
    invokeTask http://localhost:4300/polyfills.bundle.js:6709
    runTask http://localhost:4300/polyfills.bundle.js:6482
    drainMicroTaskQueue http://localhost:4300/polyfills.bundle.js:6888
    invokeTask http://localhost:4300/polyfills.bundle.js:6789
    invoke http://localhost:4300/polyfills.bundle.js:6774
    timer http://localhost:4300/polyfills.bundle.js:8568
vendor.bundle.js:367231:19

如何获得比 bundle.js 第 367231 行 [object object] 更有意义的内容?

FWIW,这个特定的行试图 console.log 一个 values 变量,结果是一个函数,在执行时 returns 空字符串。它似乎是 angular 的内部代码,因为评论中到处都是 (c) Google

我试过运行ng serve --build-optimizer=false,但它仍然优化。我也没有在 .angular-cli.json 中看到切换此选项的选项。

我也不明白为什么它似乎构建了 sourcemaps 但没有提取它们来提供有意义的跟踪:

Date: 2019-12-17T14:39:51.960Z
Hash: 436f24accaf17c10807d
Time: 22366ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 332 kB {vendor} [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 365 kB {inline} [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 1.02 MB {inline} [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 15.4 MB [initial] [rendered]

解决方案是使用 Chrome...尽管我认为 Chrome 对互联网不利,但此解决了问题。它显示实际错误而不是 [object Object],并使用 sourcemaps 显示原始代码中的确切位置而不是缩小的捆绑工件中的位置。