【发布时间】:2017-01-17 19:59:37
【问题描述】:
鉴于以下错误:
异常:未捕获(承诺中):TypeError:无法设置只有 getter 的 [object Object] 的属性堆栈 TypeError:无法设置只有 getter 的 [object Object] 的属性堆栈
我得到的堆栈跟踪是巨大的,我不知道哪个打字稿文件具有只读属性。有没有办法告诉我它试图设置的属性只有一个 getter?
一个快速而肮脏的解决方案是一个接一个地删除代码,直到它工作为止。我将能够分辨出它阻塞的代码范围以及那里会出现什么问题。但是,如果从长远来看代码突然中断,那么他的这种解决方案并不理想,如果不查看版本历史,我将不知道是什么导致了它。
有什么工具可以帮助我解决这个问题吗?
Error: Uncaught (in promise): TypeError: Cannot set property stack of [object Object] which has only a getter
TypeError: Cannot set property stack of [object Object] which has only a getter
at assignAll (http://localhost:3000/polyfills.bundle.js:16015:29)
at ViewWrappedError.ZoneAwareError (http://localhost:3000/polyfills.bundle.js:16086:16)
at ViewWrappedError.BaseError [as constructor] (http://localhost:3000/main.bundle.js:5256:16)
at ViewWrappedError.WrappedError [as constructor] (http://localhost:3000/main.bundle.js:5318:16)
at new ViewWrappedError (http://localhost:3000/main.bundle.js:57044:16)
at CompiledTemplate.proxyViewClass.DebugAppView._rethrowWithContext (http://localhost:3000/main.bundle.js:79673:23)
at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3000/main.bundle.js:79646:18)
at CompiledTemplate.proxyViewClass.AppView.internalDetectChanges (http://localhost:3000/main.bundle.js:79433:18)
at CompiledTemplate.proxyViewClass.View_ReportsComponent_Host0.detectChangesInternal (/ReportsModule/ReportsComponent/host.ngfactory.js:35:19)
at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3000/main.bundle.js:79448:14)
at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3000/main.bundle.js:79643:44)
at ViewRef_.detectChanges (http://localhost:3000/main.bundle.js:57990:20)
at RouterOutlet.activate (http://localhost:3000/main.bundle.js:63236:42)
at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/main.bundle.js:21937:16)
at ActivateRoutes.activateRoutes (http://localhost:3000/main.bundle.js:21904:26)
at http://localhost:3000/main.bundle.js:21840:58
at Array.forEach (native)
at ActivateRoutes.activateChildRoutes (http://localhost:3000/main.bundle.js:21840:29)
at ActivateRoutes.activateRoutes (http://localhost:3000/main.bundle.js:21910:22)
at http://localhost:3000/main.bundle.js:21840:58
at Array.forEach (native)
at ActivateRoutes.activateChildRoutes (http://localhost:3000/main.bundle.js:21840:29)
at ActivateRoutes.activate (http://localhost:3000/main.bundle.js:21814:14)
at http://localhost:3000/main.bundle.js:21382:22
at SafeSubscriber._next (http://localhost:3000/main.bundle.js:4169:25)
at SafeSubscriber.__tryOrUnsub (http://localhost:3000/main.bundle.js:6028:16)
at SafeSubscriber.next (http://localhost:3000/main.bundle.js:5977:22)
at Subscriber._next (http://localhost:3000/main.bundle.js:5930:26)
at Subscriber.next (http://localhost:3000/main.bundle.js:5894:18)
at MapSubscriber._next (http://localhost:3000/main.bundle.js:23024:26)
at MapSubscriber.Subscriber.next (http://localhost:3000/main.bundle.js:5894:18)
at MergeMapSubscriber.notifyNext (http://localhost:3000/main.bundle.js:22890:30)
at InnerSubscriber._next (http://localhost:3000/main.bundle.js:85350:21)
at InnerSubscriber.Subscriber.next (http://localhost:3000/main.bundle.js:5894:18)
at MapSubscriber._next (http://localhost:3000/main.bundle.js:23024:26)
at MapSubscriber.Subscriber.next (http://localhost:3000/main.bundle.js:5894:18)
at ReduceSubscriber._complete (http://localhost:3000/main.bundle.js:86357:30)
at ReduceSubscriber.Subscriber.complete (http://localhost:3000/main.bundle.js:5919:18)
at MergeMapSubscriber._complete (http://localhost:3000/main.bundle.js:22882:30)
at MergeMapSubscriber.Subscriber.complete (http://localhost:3000/main.bundle.js:5919:18)
at ArrayObservable._subscribe (http://localhost:3000/main.bundle.js:66973:24)
at ArrayObservable.Observable.subscribe (http://localhost:3000/main.bundle.js:4131:27)
at MergeMapOperator.call (http://localhost:3000/main.bundle.js:22832:23)
at Observable.subscribe (http://localhost:3000/main.bundle.js:4128:22)
at ReduceOperator.call (http://localhost:3000/main.bundle.js:86316:23)
at Observable.subscribe (http://localhost:3000/main.bundle.js:4128:22)
at MapOperator.call (http://localhost:3000/main.bundle.js:22995:23)
at Observable.subscribe (http://localhost:3000/main.bundle.js:4128:22)
at Object.subscribeToResult (http://localhost:3000/main.bundle.js:46412:27)
at MergeMapSubscriber._innerSub (http://localhost:3000/main.bundle.js:22877:38)
at MergeMapSubscriber._tryNext (http://localhost:3000/main.bundle.js:22874:14)
at MergeMapSubscriber._next (http://localhost:3000/main.bundle.js:22857:18)
at MergeMapSubscriber.Subscriber.next (http://localhost:3000/main.bundle.js:5894:18)
at MergeMapSubscriber.notifyNext (http://localhost:3000/main.bundle.js:22890:30)
at InnerSubscriber._next (http://localhost:3000/main.bundle.js:85350:21)
at InnerSubscriber.Subscriber.next (http://localhost:3000/main.bundle.js:5894:18)
at MapSubscriber._next (http://localhost:3000/main.bundle.js:23024:26)
at MapSubscriber.Subscriber.next (http://localhost:3000/main.bundle.js:5894:18)
at EverySubscriber.notifyComplete (http://localhost:3000/main.bundle.js:67454:26)
at EverySubscriber._complete (http://localhost:3000/main.bundle.js:67471:14)
at EverySubscriber.Subscriber.complete (http://localhost:3000/main.bundle.js:5919:18)
at MergeMapSubscriber._complete (http://localhost:3000/main.bundle.js:22882:30)
at MergeMapSubscriber.Subscriber.complete (http://localhost:3000/main.bundle.js:5919:18)
at ArrayObservable._subscribe (http://localhost:3000/main.bundle.js:66973:24)
at ArrayObservable.Observable.subscribe (http://localhost:3000/main.bundle.js:4131:27)
at MergeMapOperator.call (http://localhost:3000/main.bundle.js:22832:23)
at Observable.subscribe (http://localhost:3000/main.bundle.js:4128:22)
at EveryOperator.call (http://localhost:3000/main.bundle.js:67434:23)
at Observable.subscribe (http://localhost:3000/main.bundle.js:4128:22)
at MapOperator.call (http://localhost:3000/main.bundle.js:22995:23)
at Observable.subscribe (http://localhost:3000/main.bundle.js:4128:22)
at Object.subscribeToResult (http://localhost:3000/main.bundle.js:46412:27)
at MergeMapSubscriber._innerSub (http://localhost:3000/main.bundle.js:22877:38)
at MergeMapSubscriber._tryNext (http://localhost:3000/main.bundle.js:22874:14)
at MergeMapSubscriber._next (http://localhost:3000/main.bundle.js:22857:18)
at MergeMapSubscriber.Subscriber.next (http://localhost:3000/main.bundle.js:5894:18)
【问题讨论】:
标签: angular typescript webpack