Angular5升级后报错
程序员文章站
2022-05-17 18:34:40
...
这次给大家带来Angular5升级后报错,Angular5升级后报错的注意事项有哪些,下面就是实战案例,一起来看一下。
前言
RxJS是一种针对异步数据流编程工具,或者叫响应式扩展编程;可不管如何解释RxJS其目标就是异步编程,Angular引入RxJS为了就是让异步可控、更简单。可是最近在升级中遇到了一些问题,下面就来给大家介绍下,给同样遇到这个问题发朋友们一些参考,下面话不多说了,来一起看看详细的介绍吧。
Angular 5.0.5升级RxJS到5.5.3报错:
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)
这应该是RxJS升级导致的,参考issue。
方法一
在所有的route里加上pathMath:"full",如
const routes: Routes = [ { path: "", component: IndexComponent }, { path: "home", component: HomeComponent }, { path: "about", component: AboutComponent }, ... ];
改为
const routes: Routes = [ { pathMatch: 'full', path: "", component: IndexComponent }, { pathMatch: 'full', path: "home", component: HomeComponent }, { pathMatch: 'full', path: "about", component: AboutComponent }, ... ];
方法二
RxJS降为版本5.5.2。
注意:降版本时一定要把之前的卸载掉。
相信看了本文案例你已经掌握了方法,更多精彩请关注其它相关文章!
推荐阅读:
以上就是Angular5升级后报错的详细内容,更多请关注其它相关文章!
推荐阅读
-
eclipse导入jquery包后报错的解决方法
-
Mysql升级到5.7后遇到的group by查询问题解决
-
今年新iPhone将有三款:Pro版本后置三摄、升级版XR加入绿色后壳
-
Windows 10补丁更新又双叒叕惹祸 升级后桌面文件丢了
-
iOS 13.2测试版惹祸:iPad Pro用户升级后变砖
-
Android Studio 升级到3.0后输入法中文状态下无法选词的终极解决方案
-
联想笔记本升级win10后黑屏无法开机该怎么办?
-
一批安卓电视升级6.0系统后成功变砖:无法开机、电视突然无响应
-
win10浏览器打不开怎么办?升级win10后浏览器打不开问题解决办法
-
springboot整合websocket后运行测试类报错:javax.websocket.server.ServerContainer not available