Ngx-bootstrap: ERROR TypeError: generatorOrNext is not a function

Created on 14 Jun 2019  路  3Comments  路  Source: valor-software/ngx-bootstrap

EventEmitter causing an error ERROR TypeError: generatorOrNext is not a function

https://github.com/valor-software/ngx-bootstrap/blob/669d7e1d737f0d2d23ff481b7b224ff05ec0026c/src/modal/bs-modal.service.ts#L27

Modal Entry Component is defined in App SharedModule

Modals works fine on 1st level LazyLoaded module. But on 2nd lazyloaded module modal opens, but on close it throws an error:

ERROR TypeError: generatorOrNext is not a function at SafeSubscriber.schedulerFn [as _next] (core.js:13527) at SafeSubscriber../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:194) at SafeSubscriber../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:132) at Subscriber../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:76) at Subscriber../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:53) at EventEmitter../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (Subject.js:47) at EventEmitter../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit (core.js:13499) at ngx-bootstrap-modal.js:1212 at SafeSubscriber.schedulerFn [as _next] (core.js:13527) at SafeSubscriber../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:194)

Replacing EventEmitters with Subject shall fix this issue

Most helpful comment

Ups... As it turns out there was empty subscriber in nested module which caused this issue... this.modalService.onHide.subscribe()

All 3 comments

Gonna try to reproduce it on another instance.

Ups... As it turns out there was empty subscriber in nested module which caused this issue... this.modalService.onHide.subscribe()

Thank you! guy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MihaiHoriaPopescu picture MihaiHoriaPopescu  路  3Comments

RolfVeinoeSorensen picture RolfVeinoeSorensen  路  3Comments

juanitavollmering picture juanitavollmering  路  3Comments

pgeyman picture pgeyman  路  3Comments

haisaco picture haisaco  路  3Comments