【发布时间】:2016-12-20 04:03:37
【问题描述】:
所以我从 SystemJS 迁移到 Webpack (angular-cli),我必须说,真正让我感到困扰的一件事是,使用 webpack 时,错误没有引用原始文件名,因为它们都是捆绑在一起的。
我是否遗漏了什么,因为这对我来说是一个主要问题,我无法想象 Webpack 会如此受欢迎,因为这样一个关键的镜头即将到来;所以我确定我错过了什么。
这是一个例子:
Service Worker registered
App loaded ready
Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
EXCEPTION: Uncaught (in promise): Cannot decode base64
ErrorHandler.handleError
next
schedulerFn
SafeSubscriber.__tryOrUnsub
SafeSubscriber.next
Subscriber._next
Subscriber.next
Subject.next
EventEmitter.emit
NgZone.triggerError
onHandleError
ZoneDelegate.handleError
Zone.runGuarded
_loop_1
drainMicroTaskQueue
ORIGINAL STACKTRACE:
ErrorHandler.handleError
next
schedulerFn
SafeSubscriber.__tryOrUnsub
SafeSubscriber.next
Subscriber._next
Subscriber.next
Subject.next
EventEmitter.emit
NgZone.triggerError
onHandleError
ZoneDelegate.handleError
Zone.runGuarded
_loop_1
drainMicroTaskQueue
Error: Uncaught (in promise): Cannot decode base64
at resolvePromise (http://localhost:4203/main.bundle.js:204090:31) [angular]
at http://localhost:4203/main.bundle.js:204127:17 [angular]
at Object.onInvokeTask (http://localhost:4203/main.bundle.js:64676:37) [angular]
at ZoneDelegate.invokeTask (http://localhost:4203/main.bundle.js:203876:40) [angular]
at Zone.runTask (http://localhost:4203/main.bundle.js:203766:47) [<root> => angular]
at drainMicroTaskQueue (http://localhost:4203/main.bundle.js:204020:35) [<root>]
ErrorHandler.handleError
next
schedulerFn
SafeSubscriber.__tryOrUnsub
SafeSubscriber.next
Subscriber._next
Subscriber.next
Subject.next
EventEmitter.emit
NgZone.triggerError
onHandleError
ZoneDelegate.handleError
Zone.runGuarded
_loop_1
drainMicroTaskQueue
Unhandled Promise rejection: Cannot decode base64 ; Zone: angular ; Task: Promise.then ; Value: Cannot decode base64
consoleError
_loop_1
drainMicroTaskQueue
Error: Uncaught (in promise): Cannot decode base64
at resolvePromise (http://localhost:4203/main.bundle.js:204090:31) [angular]
at http://localhost:4203/main.bundle.js:204127:17 [angular]
at Object.onInvokeTask (http://localhost:4203/main.bundle.js:64676:37) [angular]
at ZoneDelegate.invokeTask (http://localhost:4203/main.bundle.js:203876:40) [angular]
at Zone.runTask (http://localhost:4203/main.bundle.js:203766:47) [<root> => angular]
at drainMicroTaskQueue (http://localhost:4203/main.bundle.js:204020:35) [<root>]
consoleError
_loop_1
drainMicroTaskQueue
但它在任何地方都没有指示文件名?!?!?
我可以打开一些神奇的源映射吗?
感谢阅读,
肖恩。
【问题讨论】:
-
浏览器控制台出现这个webpack编译错误还是app错误?
-
我将很快发布一个“更好”的错误...
-
你有 github 仓库吗?
-
当然,Angular 2 厨房水槽:ng2.javascriptninja.io 和 source@github.com/born2net/Angular-kitchen-sink 问候,肖恩
标签: angular webpack angular-cli