如何跟踪一个`EmptyError:没有元素在一个角度项目中的顺序`bug

我正在处理一个引发错误的Angular项目:core.js:1350 ERROR Error: Uncaught (in promise): EmptyError: no elements in sequence,但我似乎无法追踪它到我的任何应用程序源代码码。堆栈跟踪都指向rxjs类。如何跟踪一个`EmptyError:没有元素在一个角度项目中的顺序`bug

任何人都可以告诉我如何调试此错误,以便我可以得到在代码中的真正的错误?

core.js:1350 ERROR Error: Uncaught (in promise): EmptyError: no elements in sequence 

EmptyError: no elements in sequence

at new EmptyError (EmptyError.js:28)

at FirstSubscriber._complete (first.js:154)

at FirstSubscriber.Subscriber.complete (Subscriber.js:122)

at MergeMapSubscriber._complete (mergeMap.js:150)

at MergeMapSubscriber.Subscriber.complete (Subscriber.js:122)

at MapSubscriber.Subscriber._complete (Subscriber.js:140)

at MapSubscriber.Subscriber.complete (Subscriber.js:122)

at ArrayObservable._subscribe (ArrayObservable.js:124)

at ArrayObservable.Observable._trySubscribe (Observable.js:172)

at ArrayObservable.Observable.subscribe (Observable.js:160)

at new EmptyError (EmptyError.js:28)

at FirstSubscriber._complete (first.js:154)

at FirstSubscriber.Subscriber.complete (Subscriber.js:122)

at MergeMapSubscriber._complete (mergeMap.js:150)

at MergeMapSubscriber.Subscriber.complete (Subscriber.js:122)

at MapSubscriber.Subscriber._complete (Subscriber.js:140)

at MapSubscriber.Subscriber.complete (Subscriber.js:122)

at ArrayObservable._subscribe (ArrayObservable.js:124)

at ArrayObservable.Observable._trySubscribe (Observable.js:172)

at ArrayObservable.Observable.subscribe (Observable.js:160)

at resolvePromise (zone.js:824)

at resolvePromise (zone.js:795)

at eval (zone.js:873)

at ZoneDelegate.invokeTask (zone.js:425)

at Object.onInvokeTask (core.js:4621)

at ZoneDelegate.invokeTask (zone.js:424)

at Zone.runTask (zone.js:192)

at drainMicroTaskQueue (zone.js:602)

at <anonymous>

回答:

此错误是由于Angular路由器的最新版本。 您可以反转您的版本或追加pathMatch: 'full'到您的所有路线。

参见github issue。

Example

以上是 如何跟踪一个`EmptyError:没有元素在一个角度项目中的顺序`bug 的全部内容, 来源链接: utcz.com/qa/258165.html

回到顶部