Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.5.3 EmptyError: no elements in sequence #3151

Closed
huineng opened this issue Dec 2, 2017 · 30 comments · Fixed by #3152
Closed

5.5.3 EmptyError: no elements in sequence #3151

huineng opened this issue Dec 2, 2017 · 30 comments · Fixed by #3152

Comments

@huineng
Copy link

huineng commented Dec 2, 2017

RxJS version:
5.5.3

Code to reproduce:
since my update to 5.5.3 i'm getting errors in otherwise perfectly fine running angular 5.x application

this is the error i'm getting this morning

all was working perfectly prior to 5.5.3

difficult for me to trap what the reason could be thanks

Error: Uncaught (in promise): EmptyError: no elements in sequence
EmptyError: no elements in sequence
    at new EmptyError (EmptyError.js:27)
    at FirstSubscriber._complete (first.js:154)
    at FirstSubscriber.Subscriber.complete (Subscriber.js:121)
    at MergeMapSubscriber._complete (mergeMap.js:144)
    at MergeMapSubscriber.Subscriber.complete (Subscriber.js:121)
    at MapSubscriber.Subscriber._complete (Subscriber.js:139)
    at MapSubscriber.Subscriber.complete (Subscriber.js:121)
    at EmptyObservable._subscribe (EmptyObservable.js:82)
    at EmptyObservable.Observable._trySubscribe (Observable.js:173)
    at EmptyObservable.Observable.subscribe (Observable.js:161)
    at new EmptyError (EmptyError.js:27)
    at FirstSubscriber._complete (first.js:154)
    at FirstSubscriber.Subscriber.complete (Subscriber.js:121)
    at MergeMapSubscriber._complete (mergeMap.js:144)
    at MergeMapSubscriber.Subscriber.complete (Subscriber.js:121)
    at MapSubscriber.Subscriber._complete (Subscriber.js:139)
    at MapSubscriber.Subscriber.complete (Subscriber.js:121)
    at EmptyObservable._subscribe (EmptyObservable.js:82)
    at EmptyObservable.Observable._trySubscribe (Observable.js:173)
    at EmptyObservable.Observable.subscribe (Observable.js:161)
    at AppErrorHandler.handleError (app.exception.ts:47)
    at Object.next (core.js:5377)
    at SafeSubscriber.schedulerFn [as _next] (core.js:4223)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:246)
    at SafeSubscriber.next (Subscriber.js:193)
    at Subscriber._next (Subscriber.js:132)
    at Subscriber.next (Subscriber.js:96)
    at EventEmitter.Subject.next (Subject.js:63)
    at EventEmitter.emit (core.js:4203)
    at core.js:4652
@hugograf
Copy link

hugograf commented Dec 2, 2017

After an update of my angular project I get the same error. In my case, routing with children and outlets doesn't work.

@thisisgit
Copy link

Experiencing the same thing. Had to fix rxjs version in package.json to prevent CI from installing version 5.5.3: "rxjs": "5.5.2"

@ajmarmar
Copy link

ajmarmar commented Dec 2, 2017

HI,

I've the same error.

@Cito
Copy link

Cito commented Dec 2, 2017

Me too with an Angular 5.0.5 project. After downgrading rxjs to 5.5.2 the problem went away.

@Cito
Copy link

Cito commented Dec 2, 2017

See Angular issue #20752 for a minimal reproduction of the problem.

@rodrigodata
Copy link

@Cito that solved!

@locomotif
Copy link

FYI: In react project, v5.5.3 upgrade also breaking app. In this case import Rx from 'rxjs/Rx' is returning undefined; producing TypeError: Cannot read property 'Subject' of undefined. This was functioning fine prior to to this minor release.

@kwonoj
Copy link
Member

kwonoj commented Dec 2, 2017

I'll try to look into this shortly.

@aitboudad
Copy link

  • I noticed a small regression in bundle size ~10kb when upgrade from 5.5.2 -> 5.5.3

@zimme
Copy link

zimme commented Dec 2, 2017

This is breaking prettier/prettier-eslint-cli as we're doing import Rx from "rxjs/Rx"; which is now returning undefined so we can't access Rx.Observable.....

Update:
I've updated the way we import rxjs in the package so this isn't a problem for us any longer.

Edit: I've must have put this in the wrong issue 😕

@kwonoj
Copy link
Member

kwonoj commented Dec 3, 2017

We have added quick fix for this and patch will be released soon.

@rfanjul
Copy link

rfanjul commented Dec 3, 2017

I got the error also with 5.5.3 , does it already work ?

@dhabierre
Copy link

dhabierre commented Dec 3, 2017

This can help (using rxjs 5.5.3 - "rxjs": "^5.5.2")

Bug with empty path:

const routes: Routes = [
{ path: "", component: SynthesisComponent },
{ path: "home", component: SynthesisComponent },
{ path: "about", component: AboutComponent },
...
];

Ok when using pathMatch: 'full':

const routes: Routes = [
{ pathMatch: 'full', path: "", component: SynthesisComponent },
{ pathMatch: 'full', path: "home", component: SynthesisComponent },
{ pathMatch: 'full', path: "about", component: AboutComponent },
...
];

From angular/angular-cli#8724 (nawnitraman)

@mixalistzikas
Copy link

Is this a temporary solution or a standard solution? Are you going to release a bug fix?

@vishwass
Copy link

vishwass commented Dec 4, 2017

Fixed this issue in my setup by changing rxjs from ^5.4.2 to 5.5.2.

sambaptista added a commit to Ecodev/dilps that referenced this issue Dec 4, 2017
sis0k0 added a commit to NativeScript/nativescript-angular that referenced this issue Dec 5, 2017
To make tests work until the fix for
ReactiveX/rxjs#3151 is released.
sis0k0 added a commit to NativeScript/nativescript-angular that referenced this issue Dec 5, 2017
To make tests work until the fix for
ReactiveX/rxjs#3151 is released.
@cracautanu
Copy link

quick fix tested in 2 projects - in package.json replace "rxjs": "^5.5.2" or "rxjs": "^5.5.3" with "rxjs": "5.5.2"

@SivaPrasanna45
Copy link

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)
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 ZoneTask.invokeTask [as invoke] (zone.js:503)
at invokeTask (zone.js:1540)

I want solve this problem with RxJS5.5.3 only, is there any solution for that?

tumadash pushed a commit to tumadash/startup that referenced this issue Dec 5, 2017
@johnedvard
Copy link

johnedvard commented Dec 6, 2017

I am getting the same error when I press an anchor element, and the anchor element is using [routerLink]="'somePath'". I do not know if this is limited to anchor tags or not. I am using rxjs:5.2.2, as suggested by some others, but I am still receiving errors. (Adding pathMatch:'full' to the routes in the router module as sugested by @dhabierre works though).

@batcoder1
Copy link

batcoder1 commented Dec 6, 2017

I have had the same problem. It was because I was using a modal from ng2-bootstrap-modal.
import { BootstrapModalModule } from 'ng2-bootstrap-modal';
If this is your case. Try use forRoot and pathMatch:'full' to the routes in the router module

imports: [..., ModalModule.forRoot(), ..]

@MarcusCalidus
Copy link

Please try rxjs@5.5.4 it fixed my issues

@kingo999
Copy link

kingo999 commented Dec 6, 2017

5.5.4 works

allixender added a commit to ZGIS/smart-portal-webgui that referenced this issue Dec 6, 2017
@mmanavaz
Copy link

mmanavaz commented Dec 6, 2017

I'm still getting the same issue. I downgraded to 5.5.2 and also tried 5.5.4...both are not working for me.

@lixing0323
Copy link

update to 5.5.5 is ok.

@mmanavaz
Copy link

mmanavaz commented Dec 7, 2017

Tried 5.5.5 as you suggested- still getting the same error...

@beeman
Copy link

beeman commented Dec 7, 2017

@mmanavaz make sure to remove your node_modules and reinstall the dependencies after you changed the versions. If that does not help, try clearing your npm cache.

@mmanavaz
Copy link

mmanavaz commented Dec 8, 2017

I was able to get it working, thank you @beeman

@zee92
Copy link

zee92 commented Jan 2, 2018

I just resolved it by removing its cap (^) from "rxjs": "^5.5.2", to "rxjs": "5.5.2",

@bradtaniguchi
Copy link

bradtaniguchi commented Apr 17, 2018

I got this error in an angular app, and wanted to explain how I fixed it, in-case anyone runes into it in the future, as it doesn't seem like the most common error, and the error displayed in the console isn't very helpful at all.
I got this issue when refreshing the page on a page that uses a guard.
I found this pattern being used in my code:

// in some service used to "cache" roles
this.roles: Observable<Array<Role>>;
if (!this.roles) {
  this.roles = this.rolesService.getRoles().share(); // Using this share broke the request
}
return this.roles;

// in some guard, which crashes when getting the values
return this.rolesCache.map(roles => roles.length > 1);

I guess "caching" whatever the share() ends up throwing this error when I try to get the values later.

@tcozzens
Copy link

tcozzens commented May 3, 2018

I am still having this issue - on "version": "5.5.6" of rxjs and Angular 5.2.10. I have also tried the pathMatch: 'full' as well and it still does not work...

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.