Angular 10 Can't bind to 'ngForOf' since it isn't a known property of 'li'----- No Real Errors

Viewed 205

There is nothing wrong with my code. It will compile and serve clean. sometimes If I change a template I get the errors below in the console.

Can't bind to 'ngForOf' since it isn't a known property of 'li'. Can't bind to 'ngIf' since it isn't a known property of 'div'.

If I stop NG and then re-do: ng serve --open, everything will start working again.. later I will change some HTML and I get back into this error, and I have to keep stopping Angular in the command window and running ng serve --open again

node -v v14.12.0 npm -v 6.14.8 angular 10.1.2"

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { CommonModule } from '@angular/common';
import { AppRoutingModule } from './app-routing.module';
import { ReactiveFormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { QuestionComponent } from './question/question.component';
import { QuestionListComponent } from './question-list/question-list.component';

@NgModule({
  declarations: [
    AppComponent,    
    HomeComponent,
    QuestionComponent,
    QuestionListComponent
  ],
  imports: [
    CommonModule, 
    BrowserModule,    
    ReactiveFormsModule,    
    AppRoutingModule
    
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
1 Answers

Once I turn off AOT and Ivy that helped, perhaps it was just ivy. When I do a prod build I will turn them back on

tsconfig.app.json

"enableIvy":false,

angular.json "aot": false,

Related