-
Notifications
You must be signed in to change notification settings - Fork 772
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
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'ngDoCheck' of null #393
Comments
I faced the same issue in many places of my Application. |
@crabouif - This error you are experiencing is very weird since the constructor always ensures an valid instance of the function ClassDirective(monitor, _ngEl, _renderer, _oldRenderer, _iterableDiffers, _keyValueDiffers, _ngClassInstance) {
var _this = _super.call(this, monitor, _ngEl, _renderer) || this;
_this.monitor = monitor;
_this._ngClassInstance = _ngClassInstance;
_this._classAdapter = new BaseFxDirectiveAdapter('class', monitor, _ngEl, _renderer);
_this._ngClassAdapter = new BaseFxDirectiveAdapter('ngClass', monitor, _ngEl, _renderer);
if (!_this._ngClassInstance) {
_this._ngClassInstance = new NgClass(_iterableDiffers, _keyValueDiffers, _ngEl, _oldRenderer);
}
return _this;
} So I am completely confused how your reference could be |
First thanks for your reactivity! Sorry, for the moment, I can't do the Plunkr. But what I can say is this occures when the view is destroying. Maybe this Here is the call stack.
And some callstack print screen. Here is the destroyed view. I'm not sure because that is no flex inside?! Then here the calling of destroy. Thanks! |
@crabouif - It appears that your template is only using
This is a bug. |
Here is my HTML: <md-toolbar class="sidenav-toolbar">
<span *ngIf="isNew">Nouveau patient</span>
<span *ngIf="!isNew">Modification du patient</span>
<span class="fill-remaining-space"></span>
<df-form-model-state></df-form-model-state>
</md-toolbar>
<form #patientForm [formGroup]="patient" novalidate>
<div fxLayout="row" fxLayoutAlign="start none" class="fields-row">
<div fxLayout="column" fxLayoutAlign="start none" class="fields-column left-part">
<md-card class="address-info">
<md-card-header>Personne</md-card-header>
<div class="fields-row" formGroupName="person">
<md-input-container>
<input formControlName="politness" mdInput placeholder="Politesse" [mdAutocomplete]="autoPolitness">
</md-input-container>
<md-autocomplete #autoPolitness="mdAutocomplete">
<md-option value="Madame">Madame</md-option>
<md-option value="Monsieur">Monsieur</md-option>
</md-autocomplete>
</div>
<div fxLayout="row" fxLayoutAlign="start none" class="fields-row" formGroupName="person">
<md-input-container>
<input formControlName="firstName" mdInput placeholder="Prénom">
<md-hint *ngIf="patient.hasError('required', 'person.firstName')" [ngStyle]="{'color': 'red'}" align="start">Le prénom est requis.</md-hint>
</md-input-container>
<md-input-container>
<input formControlName="lastName" mdInput placeholder="Nom" />
<md-hint *ngIf="patient.hasError('required', 'person.lastName')" [ngStyle]="{'color': 'red'}" align="start">Le nom est requis.</md-hint>
</md-input-container>
</div>
<div class="fields-row" formGroupName="person">
<md-input-container>
<input formControlName="address" mdInput placeholder="Adresse (rue et numéro)">
</md-input-container>
</div>
<div fxLayout="row" fxLayoutAlign="start none" class="fields-row" formGroupName="person">
<md-input-container formGroupName="city" style="width:30%;">
<input formControlName="zipCode" mdInput placeholder="NPA">
</md-input-container>
<md-input-container formGroupName="city">
<input formControlName="name" mdInput placeholder="Localité">
<md-hint *ngIf="patient.hasError('required', 'person.city.zipCode') || patient.hasError('required', 'person.city.name')"
[ngStyle]="{'color': 'red'}" align="start">La personne doit au moins avoir une localité comme adresse.</md-hint>
</md-input-container>
</div>
</md-card>
<md-card class="patient-info">
<md-card-header>Patient</md-card-header>
<md-input-container>
<input type="number" formControlName="patientNumber" mdInput placeholder="Numéro du patient">
</md-input-container>
</md-card>
</div>
<div fxLayout="column" fxLayoutAlign="start none" class="fields-column right-part" formGroupName="person">
<md-card class="comm-info">
<md-card-header>Communication</md-card-header>
<md-input-container>
<input formControlName="phone" mdInput placeholder="Téléphone">
</md-input-container>
<md-input-container>
<input formControlName="email" mdInput placeholder="E-Mail">
<md-hint *ngIf="patient.get('person.email').value && patient.hasError('pattern', 'person.email')" [ngStyle]="{'color': 'red'}" align="start">E-Mail non valide.</md-hint>
</md-input-container>
</md-card>
<md-card class="other-info">
<md-card-header>Autres</md-card-header>
<md-input-container>
<input mdInput dfInputDate formControlName="birthDate" [mdDatepicker]="birthDatePicker" placeholder="Date de naissance">
<button mdSuffix [mdDatepickerToggle]="birthDatePicker"></button>
</md-input-container>
<md-datepicker #birthDatePicker></md-datepicker>
<md-select formControlName="gender" placeholder="Genre (sexe)">
<md-option value="male">Masculin</md-option>
<md-option value="female">Féminin</md-option>
<md-option value="unknown">Inconnu</md-option>
</md-select>
<md-hint *ngIf="patient.hasError('required', 'person.gender')" [ngStyle]="{'color': 'red', 'font-size': '75%'}" align="start">Le genre est requis.</md-hint>
<md-input-container>
<input formControlName="avsNumber" mdInput placeholder="N° AVS">
<md-hint *ngIf="patient.hasError('pattern', 'person.avsNumber')" [ngStyle]="{'color': 'red'}" align="start">N° AVS non valide.</md-hint>
</md-input-container>
<md-select formControlName="languageIsoCode" placeholder="Langue">
<md-option value="fr">Français</md-option>
<md-option value="de">Allemand</md-option>
<md-option value="it">Italien</md-option>
<md-option value="en">Anglais</md-option>
</md-select>
</md-card>
</div>
</div>
</form> Thanks. |
The host `class` attribute should be considered static and should not be used as a ClassDirective selector. This means that with responsive APIs, the ClassDirective will not be instantiated for elements using only the `class` attribute. * Use the `class` attribute as a responsive fallback value only. * Improve support of the ngClass directive for string and object assignments. Fixes #393.
The host `class` attribute should be considered static and should not be used as a ClassDirective selector. This means that with responsive APIs, the ClassDirective will not be instantiated for elements using only the `class` attribute. * Use the `class` attribute as a responsive fallback value only. * Improve support of the ngClass directive for string and object assignments. Fixes #393.
… be used as a ClassDirective selector. This means that without associated responsive APIs, the ClassDirective will not be instantiated for elements using only the `class` attribute. * Use the `class` attribute as a responsive fallback value only. * Improve support of the ngClass directive for string and object assignments. Fixes #393.
@crabouif - Here is a working Plunkr rendering your template (using Beta.9). I do not see any issues. |
I'm seeing this too now that I've updated to beta.9. This wasn't an issue in beta.8. The exception points to the following element: <span class="autoCompleteSeparator">-</span> That element is contained in the following div: <div fxLayout="row" fxLayoutWrap fxLayoutAlign="start center" [formGroup]="parentForm"> It only occurs if I've interacted with the component and then clicked on an element that navigates me away (where the component will be destroyed). |
… be used as a ClassDirective selector. This means that without associated responsive APIs, the ClassDirective will not be instantiated for elements using only the `class` attribute. * Use the `class` attribute as a responsive fallback value only. * Improve support of the ngClass directive for string and object assignments. Fixes #393.
… be used as a ClassDirective selector. This means that without associated responsive APIs, the ClassDirective will not be instantiated for elements using only the `class` attribute. * Use the `class` attribute as a responsive fallback value only. * Improve support of the ngClass directive for string and object assignments. Fixes #393.
I am also facing this issue even with latest release 2.0.0-beta.9 |
The host `class` attribute should be considered static and should not be used as a ClassDirective selector. This means that without associated responsive APIs, the ClassDirective will not be instantiated for elements using only the `class` attribute. * Use the `class` attribute as a responsive fallback value only. * Improve support of the ngClass directive for string and object assignments. Fixes #393.
…ve. (#394) The host `class` attribute should be considered static and should not be used as a ClassDirective selector. This means that without associated responsive APIs, the ClassDirective will not be instantiated for elements using only the `class` attribute. * Use the `class` attribute as a responsive fallback value only. * Improve support of the ngClass directive for string and object assignments. Fixes #393.
I had the same issue when using flex-layout beta.9 but was able to fix this by downgrading to beta.8 |
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. |
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
Then if I patch to
the issue doesn't apear anymore.
My context is:
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).
Thanks.
The text was updated successfully, but these errors were encountered: