EventEmitter causing an error ERROR TypeError: generatorOrNext is not a function
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
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
Most helpful comment
Ups... As it turns out there was empty subscriber in nested module which caused this issue... this.modalService.onHide.subscribe()