如何使用webpack调试Angular 2? [英] How to debug Angular 2 with webpack?

查看:100
本文介绍了如何使用webpack调试Angular 2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出以下错误:

例外:未捕获(承诺):TypeError:无法设置仅具有吸气剂的[object Object]的属性堆栈TypeError:无法设置只有吸气剂的[object Object]的属性堆栈

我得到的堆栈跟踪非常大,我不知道哪个打字稿文件令人窒息,它具有只读属性.有什么方法可以告诉我它要设置的仅具有吸气剂的属性吗?

The stack trace that I get is huge and I have no clue which typescript file is choking that has a read only property. Is there a way that will tell me which property it is trying to set that has only a getter?

一种快速而肮脏的解决方案是逐个删除代码,直到它起作用为止.我可以分辨出是哪个代码范围阻塞了,那里出现了什么问题.但是,如果从长远来看,代码突然中断了,那么他的解决方案就不是理想的选择了,而如果不查看版本历史,我将不知道是什么导致了中断.

A quick and dirty solution is to one by one remove code until it works. I would be able to tell which scope of the code it was choking and what would be the problem there. However, if in the long run the code suddenly breaks, then his kind of solution is not ideal and I would have no idea what broke it without looking at the version histories.

有没有可以帮助我解决这个问题的工具?

Is there a tool that would help me with this?

<代码>错误:未捕获(承诺):TypeError:无法设置仅具有吸气剂的[object Object]的属性堆栈TypeError:无法设置只有吸气剂的[object Object]的属性堆栈在assignAll(http://localhost:3000/polyfills.bundle.js:16015:29)在ViewWrappedError.ZoneAwareError(http://localhost:3000/polyfills.bundle.js:16086:16)在ViewWrappedError.BaseError上[作为构造函数](http://localhost:3000/main.bundle.js:5256:16)在ViewWrappedError.WrappedError上[作为构造函数](http://localhost:3000/main.bundle.js:5318:16)在新的ViewWrappedError(http://localhost:3000/main.bundle.js:57044:16)在CompiledTemplate.proxyViewClass.DebugAppView._rethrowWithContext(http://localhost:3000/main.bundle.js:79673:23)在CompiledTemplate.proxyViewClass.DebugAppView.detectChanges(http://localhost:3000/main.bundle.js:79646:18)在CompiledTemplate.proxyViewClass.AppView.internalDetectChanges(http://localhost:3000/main.bundle.js:79433:18)在CompiledTemplate.proxyViewClass.View_ReportsComponent_Host0.detectChangesInternal(/ReportsModule/ReportsComponent/host.ngfactory.js:35:19)在CompiledTemplate.proxyViewClass.AppView.detectChanges(http://localhost:3000/main.bundle.js:79448:14)在CompiledTemplate.proxyViewClass.DebugAppView.detectChanges(http://localhost:3000/main.bundle.js:79643:44)在ViewRef_.detectChanges(http://localhost:3000/main.bundle.js:57990:20)在RouterOutlet.activate(http://localhost:3000/main.bundle.js:63236:42)在ActivateRoutes.placeComponentIntoOutlet(http://localhost:3000/main.bundle.js:21937:16)在ActivateRoutes.activateRoutes(http://localhost:3000/main.bundle.js:21904:26)在http://localhost:3000/main.bundle.js:21840:58在Array.forEach(本机)在ActivateRoutes.activateChildRoutes(http://localhost:3000/main.bundle.js:21840:29)在ActivateRoutes.activateRoutes(http://localhost:3000/main.bundle.js:21910:22)在http://localhost:3000/main.bundle.js:21840:58在Array.forEach(本机)在ActivateRoutes.activateChildRoutes(http://localhost:3000/main.bundle.js:21840:29)在ActivateRoutes.activate(http://localhost:3000/main.bundle.js:21814:14)在http://localhost:3000/main.bundle.js:21382:22在SafeSubscriber._next(http://localhost:3000/main.bundle.js:4169:25)在SafeSubscriber .__ tryOrUnsub(http://localhost:3000/main.bundle.js:6028:16)在SafeSubscriber.next(http://localhost:3000/main.bundle.js:5977:22)在Subscriber._next(http://localhost:3000/main.bundle.js:5930:26)在Subscriber.next(http://localhost:3000/main.bundle.js:5894:18)在MapSubscriber._next(http://localhost:3000/main.bundle.js:23024:26)在MapSubscriber.Subscriber.next(http://localhost:3000/main.bundle.js:5894:18)在MergeMapSubscriber.notifyNext(http://localhost:3000/main.bundle.js:22890:30)在InnerSubscriber._next(http://localhost:3000/main.bundle.js:85350:21)在InnerSubscriber.Subscriber.next(http://localhost:3000/main.bundle.js:5894:18)在MapSubscriber._next(http://localhost:3000/main.bundle.js:23024:26)在MapSubscriber.Subscriber.next(http://localhost:3000/main.bundle.js:5894:18)在ReduceSubscriber._complete(http://localhost:3000/main.bundle.js:86357:30)在ReduceSubscriber.Subscriber.complete(http://localhost:3000/main.bundle.js:5919:18)在MergeMapSubscriber._complete(http://localhost:3000/main.bundle.js:22882:30)在MergeMapSubscriber.Subscriber.complete(http://localhost:3000/main.bundle.js:5919:18)在ArrayObservable._subscribe(http://localhost:3000/main.bundle.js:66973:24)在ArrayObservable.Observable.subscribe(http://localhost:3000/main.bundle.js:4131:27)在MergeMapOperator.call(http://localhost:3000/main.bundle.js:22832:23)在Observable.subscribe(http://localhost:3000/main.bundle.js:4128:22)在ReduceOperator.call(http://localhost:3000/main.bundle.js:86316:23)在Observable.subscribe(http://localhost:3000/main.bundle.js:4128:22)在MapOperator.call(http://localhost:3000/main.bundle.js:22995:23)在Observable.subscribe(http://localhost:3000/main.bundle.js:4128:22)在Object.subscribeToResult(http://localhost:3000/main.bundle.js:46412:27)在MergeMapSubscriber._innerSub(http://localhost:3000/main.bundle.js:22877:38)在MergeMapSubscriber._tryNext(http://localhost:3000/main.bundle.js:22874:14)在MergeMapSubscriber._next(http://localhost:3000/main.bundle.js:22857:18)在MergeMapSubscriber.Subscriber.next(http://localhost:3000/main.bundle.js:5894:18)在MergeMapSubscriber.notifyNext(http://localhost:3000/main.bundle.js:22890:30)在InnerSubscriber._next(http://localhost:3000/main.bundle.js:85350:21)在InnerSubscriber.Subscriber.next(http://localhost:3000/main.bundle.js:5894:18)在MapSubscriber._next(http://localhost:3000/main.bundle.js:23024:26)在MapSubscriber.Subscriber.next(http://localhost:3000/main.bundle.js:5894:18)在EverySubscriber.notifyComplete(http://localhost:3000/main.bundle.js:67454:26)在EverySubscriber._complete(http://localhost:3000/main.bundle.js:67471:14)在EverySubscriber.Subscriber.complete(http://localhost:3000/main.bundle.js:5919:18)在MergeMapSubscriber._complete(http://localhost:3000/main.bundle.js:22882:30)在MergeMapSubscriber.Subscriber.complete(http://localhost:3000/main.bundle.js:5919:18)在ArrayObservable._subscribe(http://localhost:3000/main.bundle.js:66973:24)在ArrayObservable.Observable.subscribe(http://localhost:3000/main.bundle.js:4131:27)在MergeMapOperator.call(http://localhost:3000/main.bundle.js:22832:23)在Observable.subscribe(http://localhost:3000/main.bundle.js:4128:22)在EveryOperator.call(http://localhost:3000/main.bundle.js:67434:23)在Observable.subscribe(http://localhost:3000/main.bundle.js:4128:22)在MapOperator.call(http://localhost:3000/main.bundle.js:22995:23)在Observable.subscribe(http://localhost:3000/main.bundle.js:4128:22)在Object.subscribeToResult(http://localhost:3000/main.bundle.js:46412:27)在MergeMapSubscriber._innerSub(http://localhost:3000/main.bundle.js:22877:38)在MergeMapSubscriber._tryNext(http://localhost:3000/main.bundle.js:22874:14)在MergeMapSubscriber._next(http://localhost:3000/main.bundle.js:22857:18)在MergeMapSubscriber.Subscriber.next(http://localhost:3000/main.bundle.js:5894:18)

推荐答案

更新

已在 0.7.6

https://github.com/angular/zone.js/blob/master/CHANGELOG.md#076-2017-01-17

以前的版本

将zonejs降级到 0.7.4 https://github.com/angular/zone.js/issues/595

Downgrade zonejs to 0.7.4 https://github.com/angular/zone.js/issues/595

npm install --save zone.js@0.7.4

这篇关于如何使用webpack调试Angular 2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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