Home > Web Front-end > JS Tutorial > How to solve the error problem when Angular5 upgrades RxJS to 5.5.3

How to solve the error problem when Angular5 upgrades RxJS to 5.5.3

php中世界最好的语言
Release: 2018-05-25 15:18:46
Original
2387 people have browsed it

This time I will show you how to solve the problem of error when upgrading RxJS in Angular5 to 5.5.3, and how to solve the error when upgrading RxJS to 5.5.3 in Angular5NotesWhat are they? The following is a practical case. Let’s take a look.

Preface

RxJS is a tool for asynchronous data flowprogramming, or responsive extended programming; it can No matter how you explain RxJS, its goal is asynchronous programming. Angular introduced RxJS to make asynchronous controllable and simpler. However, I have encountered some problems during the upgrade recently. Let me introduce them to you and give some reference to friends who also encounter this problem. I won’t go into details below, let’s take a look at the detailed introduction.

Angular 5.0.5 upgraded RxJS to 5.5.3 and reported an error:

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 EmptyObservable._subscribe (EmptyObservable.js:83)
 at EmptyObservable.Observable._trySubscribe (Observable.js:172)
 at EmptyObservable.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 EmptyObservable._subscribe (EmptyObservable.js:83)
 at EmptyObservable.Observable._trySubscribe (Observable.js:172)
 at EmptyObservable.Observable.subscribe (Observable.js:160)
 at resolvePromise (zone.js:824)
Copy after login

This should be caused by the RxJS upgrade, please refer to the issue.

Method 1

Add pathMath: "full" to all routes, such as

const routes: Routes = [
 { path: "", component: IndexComponent },
 { path: "home", component: HomeComponent },
 { path: "about", component: AboutComponent },
 ...
];
Copy after login

is changed to

const routes: Routes = [
 { pathMatch: 'full', path: "", component: IndexComponent },
 { pathMatch: 'full', path: "home", component: HomeComponent },
 { pathMatch: 'full', path: "about", component: AboutComponent },
 ...
];
Copy after login

Method 2

RxJS is downgraded to version 5.5.2.

Note: Be sure to uninstall the previous version when downgrading.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How to hot replace the webpack module

How to build a vue2.0 boostrap project

The above is the detailed content of How to solve the error problem when Angular5 upgrades RxJS to 5.5.3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template