Repository navigation
Description
Bug
Starting with angular cdk version 6.4.3 there seems to be an incompatibility with zone-patch-rxjs which causes an infinite loop. For this reason some components, in our case the datepicker, won't work as expected.
What is the expected behavior?
When selecting a date in the datepicker (or closing it by clicking outside of the datepicker) it should not cause an error. It should also be possible to open the datepicker a second time.
What is the current behavior?
When selecting a date in the datepicker it throws a "Maximum call stack size exceeded" error. When opening the datepicker the second time it doesn't show the calendar, but an empty flyout.
Note: That's only true for angular cdk versions >= 6.4.3 and if "zone-patch-rxjs" is included. And also it's only broken for non touch-ui mode.
What are the steps to reproduce?
- Create an angular cli project
- Install angular material in the latest version (incl angular cdk in latest version)
- Integrate a datepicker on the page
- Load zone-patch-rxjs
- Start the application
- Open the datepicker
- Select a date
- Try to open the datepicker again
Example on stackblitz which is not working same example with angular cdk version 6.4.2 that is working as expected. You can get from one to the other with installing the dependencies @angular/cdk@6.4.3 @angular/material@6.4.3 @angular/material-moment-adapter@6.4.3 or the other way around with 6.4.2. That's the only difference.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
- Chrome Version 68.0.3440.84 (official build) (64-Bit)
- Firefox 61.0.1 (64-Bit)
- Typescript 2.7.2
- Angular Material (and CDK) >= 6.4.3
- rxjs 6.2.2 (and rxjs-compat 6.2.2)
- zone.js 0.8.26
- Angular 6.1.2
- Ubuntu 18.04
However, the issue doesn't seem to be browser, TypeScript, or OS related. Angular CDK, zone.js and maybe rxjs seem to be the important factors.
Activity
igorivaniuk commentedon Aug 19, 2018
Same bug with mat-menu.
v6.4.2 works
josephperrott commentedon Sep 6, 2018
From looking through the changelog its possible that #12414 caused this change.
I am unsure of if this is something we consider an error or simply an incompatibility with our library.
crisbeto commentedon Sep 7, 2018
I'm not super convinced that #12414 could've caused it. The
onStablecall does happen inside theNgZone, but then the callback is outside and I don't see any logic that would cause it to go back in.vitorplopes commentedon Sep 11, 2018
@angular/cdk@6.4.7 and @angular/material@6.4.7 face the same issue.
ERROR RangeError: Maximum call stack size exceeded at Function.get [as current] (zone.js:64) at SafeSubscriber.value [as unsubscribe] (zone-patch-rxjs.js:126) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.unsubscribe (Subscriber.js:77) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:212) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:147) at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:80) at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:55) at Subscriber.Subscriber.next (zone-patch-rxjs.js:163)tfernandescunha commentedon Sep 11, 2018
@angular/cdk@6.4.7 and @angular/material@6.4.7 face the same issue.
ERROR RangeError: Maximum call stack size exceeded at Function.get [as current] (zone.js:64) at SafeSubscriber.value [as unsubscribe] (zone-patch-rxjs.js:126) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.unsubscribe (Subscriber.js:77) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:212) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:147) at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:80) at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:55) at Subscriber.Subscriber.next (zone-patch-rxjs.js:163)fix(overlay): infinite loop when used together with zone-patch-rxjs
fix(overlay): infinite loop when used together with zone-patch-rxjs (#…
stefan-leye commentedon Jan 2, 2019
I still get the error with version 7.2.0
stefan-leye commentedon Jan 2, 2019
The problem seems to be the use of onStable here:
https://github.com/angular/material2/blob/master/src/cdk/overlay/overlay-ref.ts#L133
But putting it into ngZone.runOutsideAngular seems to breaks other stuff.
wescopeland commentedon Feb 7, 2019
I'm encountering the same problem. I definitely do not believe this issue should be closed.
angular-automatic-lock-bot commentedon Sep 10, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.