MatPaginator.html gives TypeError: Cannot read property 'subscribe' of undefined
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
No Errors
What is the current behavior?
Currently while using Material Table <table mat-table #sort="matSort" [dataSource]="dataSource" matSort matSortDisableClear></table>
What are the steps to reproduce?
https://stackblitz.com/edit/angular-va2xwy?file=src%2Fapp%2Fapp.component.ts
What is the use-case or motivation for changing an existing behavior?
The error i get is the same but it also points me to MatPaginator.html. Below is the exact error that i face.
MatPaginator.html:1 ERROR TypeError: Cannot read property 'subscribe' of undefined at Observable.push../node_modules/rxjs/_esm5/Observable.js.Observable._subscribe (Observable.js:231) at Observable.push../node_modules/rxjs/_esm5/Observable.js.Observable._trySubscribe (Observable.js:172) at Observable.push../node_modules/rxjs/_esm5/Observable.js.Observable.subscribe (Observable.js:160)
I face the same issue while using other material elements and those sometimes break. I believe these issues are related and just a configuration change or a package version change would solve it for us.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular CLI: 6.1.5 Node: 8.11.3 OS: win32 x64 Angular: 6.1.6 … animations, common, compiler, compiler-cli, core, forms … http, platform-browser, platform-browser-dynamic, router
Package Version
@angular-devkit/architect 0.7.5 @angular-devkit/build-angular 0.7.5 @angular-devkit/build-optimizer 0.7.5 @angular-devkit/build-webpack 0.7.5 @angular-devkit/core 0.7.5 @angular-devkit/schematics 0.7.5 @angular/cdk 6.4.7 @angular/cli 6.1.5 @angular/material 6.4.7 @ngtools/webpack 6.1.5 @schematics/angular 0.7.5 @schematics/update 0.7.5 rxjs 5.6.0-forward-compat.5 typescript 2.9.2 webpack 4.9.2
Is there anything else we should know?
I searched a lot but could not find a solution to my problem. If you have any resources that would help me fix my issue then please point me towards it
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
Closing as it seems that the issue you was caused by a mismatch in the versions of angular’s platform packages being used.
@angular/forms
was at6.0.0
while other@angular
platform packages were6.1.7
, upon moving@angular/forms
to6.1.7
everything works as expected.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.