-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Comments
I've got the same error. The workaround is described in |
@anymos Yeah, I've seen, I think it should be documented somehow |
Agreed, wondering if it is going to be tough to fix actually in material lib |
It looks like a solution for this is blocked on angular/angular#23715 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
monitor
andstopMonitoring
methods should be definedWhat 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
, foundngOnInit
hook and addedconsole.log(typeof this._autofillMonitor.monitor);
, same withstopMonitoring
It printed two values -
undefined
andfunction
, because this directive is instantiated twice, once on the server and on the client.The text was updated successfully, but these errors were encountered: