This repository was archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 764
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'ngDoCheck' of null #393
Copy link
Copy link
Closed
Labels
P1Urgent issue that should be resolved before the next re-leaseUrgent issue that should be resolved before the next re-leasebughas prA PR has been created to address this issueA PR has been created to address this issue
Milestone
Description
I have a form with some flex layout inside. But sometimes when I change the route by a link, the app crash with error
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'ngDoCheck' of null
I found that happen in file flex-layout.es5.js line 2906. The piece of code is
ClassDirective.prototype.ngDoCheck = function () {
if (!this._classAdapter.hasMediaQueryListener) {
this._configureMQListener();
}
this._ngClassInstance.ngDoCheck();
};
Then if I patch to
ClassDirective.prototype.ngDoCheck = function () {
if (!this._classAdapter.hasMediaQueryListener) {
this._configureMQListener();
}
if (this._ngClassInstance) {
this._ngClassInstance.ngDoCheck();
}
};
the issue doesn't apear anymore.
My context is:
@angular/cli: 1.3.2
node: 7.10.1
os: linux x64
@angular/animations: 4.3.6
@angular/cdk: 2.0.0-beta.8
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/flex-layout: 2.0.0-beta.9
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/material: 2.0.0-beta.8
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.3.2
@angular/compiler-cli: 4.3.6
@angular/language-service: 4.3.6
I dont know if its related, but I have a reactive form and each time the user change something, I save the values. This issue happen after a various number of modifications (and so saves).
form.valueChanges
.debounceTime(1000)
.distinctUntilChanged()
.filter(v => form.valid)
.subscribe(v => {
this.state = FormModelState.Saving;
(<Observable<Response>>this.save())
.subscribe(res => {
this.state = FormModelState.Saved;
this.error = "";
},
e => {
this.state = FormModelState.SaveError;
this.error = e;
}
);
});
Thanks.
Splaktar, gbrath, PierreDuc, naveedahmed1, zorky and 1 more
Metadata
Metadata
Assignees
Labels
P1Urgent issue that should be resolved before the next re-leaseUrgent issue that should be resolved before the next re-leasebughas prA PR has been created to address this issueA PR has been created to address this issue