question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MatPaginator.html gives TypeError: Cannot read property 'subscribe' of undefined

See original GitHub issue

Bug, 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:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
josephperrottcommented, Sep 7, 2018

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 at 6.0.0 while other @angular platform packages were 6.1.7, upon moving @angular/forms to 6.1.7 everything works as expected.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 11, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MatPaginator.html gives TypeError: Cannot read property ...
html. Below is the exact error that i face. MatPaginator.html:1 ERROR TypeError: Cannot read property 'subscribe' of undefined at Observable.
Read more >
Angular "Cannot read property 'subscribe' of undefined"
The solution to this is that your getRecipes () method SHOULD NOT SUBSCRIBE. It should return either a Promise or an Observable.
Read more >
Cannot read property 'subscribe' of undefined - ng-mocks
This issue means that something has been replaced with a mock object and returns a dummy result ( undefined ) instead of observable...
Read more >
ERROR TypeError: Cannot read properties of undefined ...
The subscription pulls out that data and then you can assign the data to a component level variable. You would set this.listIngs =...
Read more >
The AI Search Engine You Control
TypeError : Cannot read property '0' of undefined when reading params of ActivatedRoute - Angular 6 testing in Jasmine/Karma.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found