我现在正在开发一个 Angular2 应用程序几个星期,几天前我遇到了这个问题。
该问题发生在 rxJS 流上第一次调用 subscribe 或 toPromise 时,并且似乎根本没有破坏应用程序的行为。然而,它确实抛出了浏览器的控制台输出,并且似乎阻止了调试(因为 zone.js 和应用程序之间的连接丢失了?)
无论首先加载哪个订阅,无论在 Google chrome 和 firefox 中,都会发生这种情况。
如果我得到更多信息,我会尝试更新这个问题,但目前这就是我所知道的。
非常无用的堆栈跟踪:
browser_adapter.js:76 EXCEPTION:
UnsubscriptionErrorBrowserDomAdapter.logError @ browser_adapter.js:76
BrowserDomAdapter.logGroup @ browser_adapter.js:86
ExceptionHandler.call @ exception_handler.js:56
(anonymous function) @ application_ref.js:193
schedulerFn @ async.js:122
SafeSubscriber.__tryOrUnsub @ Subscriber.js:166
SafeSubscriber.next @ Subscriber.js:115
Subscriber._next @ Subscriber.js:74
Subscriber.next @ Subscriber.js:51
Subject._finalNext @ Subject.js:124
Subject._next @ Subject.js:116
Subject.next @ Subject.js:73
EventEmitter.emit @ async.js:11
1NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.js:119
NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.js:65
ZoneDelegate.handleError @ zone.js:364
Zone.runTask @ zone.js:293
ZoneTask.invoke @ zone.js:460
XMLHttpRequest.send (async)scheduleTask @ zone.js:100
ZoneDelegate.scheduleTask @ zone.js:373
Zone.longStackTraceZoneSpec.onScheduleTask @ long-stack-trace-zone.js:119
ZoneDelegate.scheduleTask @ zone.js:370
Zone.scheduleMacroTask @ zone.js:310
(anonymous function) @ zone.js:121
send @ VM76503:3(
anonymous function) @ xhr_backend.js:76
Observable.subscribe @ Observable.js:58
Observable._subscribe @ Observable.js:99
Observable.subscribe @ Observable.js:55
Observable._subscribe @ Observable.js:99
Observable.subscribe @ Observable.js:55
AccountScreen.routerOnActivate @ account_screen.ts:56
(anonymous function) @ router_outlet.js:67
ZoneDelegate.invoke @ zone.js:36
0NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.js:44
ZoneDelegate.invoke @ zone.js:359
Zone.run @ zone.js:253
(anonymous function) @ zone.js:605
ZoneDelegate.invokeTask @ zone.js:393
NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.js:35
ZoneDelegate.invokeTask @ zone.js:392
Zone.runTask @ zone.js:290
drainMicroTaskQueue @ zone.js:511
ZoneTask.invoke @ zone.js:463