h2qutc / angular-material-components

Angular Material Library provide extra components for every project
https://h2qutc.github.io/angular-material-components/
MIT License
331 stars 162 forks source link

getting errors when using with reactive forms/formBuilder #94

Open Rebal67 opened 4 years ago

burner commented 4 years ago

I might be getting the same error.

ERROR TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    at subscribeTo (subscribeTo.ts:27)
    at innerSubscribe (innerSubscribe.ts:113)
    at MergeMapSubscriber._innerSub (mergeMap.ts:144)
    at MergeMapSubscriber._tryNext (mergeMap.ts:137)
    at MergeMapSubscriber._next (mergeMap.ts:121)
    at MergeMapSubscriber.next (Subscriber.ts:99)
    at Observable._subscribe (subscribeToArray.ts:9)
    at Observable._trySubscribe (Observable.ts:238)
    at Observable.subscribe (Observable.ts:219)
    at MergeMapOperator.call (mergeMap.ts:96)

with angular 10.2.1

digaus commented 4 years ago

Same

tanshunyuan commented 4 years ago

Following this, I downgraded my package version to 4.0.3 and the error went away. This is a temporary solution until the author issue a fix.

ractoc commented 3 years ago

I'm having the same problem with version 5.0.3 of the library. I've managed to trace it back to: datePicker.js: _watchStateChanges() { const datepickerStateChanged = this.datepicker ? this.datepicker.stateChanges : of(); const inputStateChanged = this.datepicker && this.datepicker.datepickerInput ? this.datepicker.datepickerInput.stateChanges : of(); const datepickerToggled = this.datepicker ? merge(this.datepicker.openedStream, this.datepicker.closedStream) : of(); this._stateChanges.unsubscribe(); this._stateChanges = merge(this._intl.changes, datepickerStateChanged, inputStateChanged, datepickerToggled).subscribe(() => this._changeDetectorRef.markForCheck()); } this.datepicker.stateChanges appears to be undefined. No real idea how this is possible yet, nor if this is as intended. But the merge call eventually runs in the undefined bug, and since this is the only variable going in there which is undefined, it stands to reason that this might be the culprit.

Mintenker commented 3 years ago

Same issue as reported in #170, There is some more info there - as well as workaround.