Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mat-input] SSR crashes because of undefined functions #11603

Closed
arturovt opened this issue May 31, 2018 · 5 comments · Fixed by #11604
Closed

[mat-input] SSR crashes because of undefined functions #11603

arturovt opened this issue May 31, 2018 · 5 comments · Fixed by #11604
Labels
blocked This issue is blocked by some external factor, such as a prerequisite PR

Comments

@arturovt
Copy link
Contributor

arturovt commented May 31, 2018

Bug, feature request, or proposal:

Bug

What is the expected behavior?

monitor and stopMonitoring methods should be defined

What is the current behavior?

Angular universal crashes with these errors
TypeError: this._autofillMonitor.monitor is not a function at MatInput.ngOnInit
TypeError: this._autofillMonitor.stopMonitoring is not a function at MatInput.ngOnDestroy

What are the steps to reproduce?

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 6.0.3

Is there anything else we should know?

I opened @angular/material/bundles/material-input.umd.js, found ngOnInit hook and added console.log(typeof this._autofillMonitor.monitor);, same with stopMonitoring
It printed two values - undefined and function, because this directive is instantiated twice, once on the server and on the client.

@anymos
Copy link

anymos commented Jun 5, 2018

I've got the same error.

The workaround is described in
#11396 and angular/angular#23715

@arturovt
Copy link
Contributor Author

arturovt commented Jun 5, 2018

@anymos Yeah, I've seen, I think it should be documented somehow

@anymos
Copy link

anymos commented Jun 6, 2018

Agreed, wondering if it is going to be tough to fix actually in material lib

@josephperrott
Copy link
Member

It looks like a solution for this is blocked on angular/angular#23715

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
@mmalerba mmalerba added the blocked This issue is blocked by some external factor, such as a prerequisite PR label Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked This issue is blocked by some external factor, such as a prerequisite PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants