question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ivy preview report: Error: ASSERTION ERROR: Reached the max number of directives

See original GitHub issue

Hi! Error when click on catalog item… Without Ivy all worked correctly.

Error: ASSERTION ERROR: Reached the max number of directives

image image

<app-store-catalog [baseUrl]="'catalog/'"></app-store-catalog>

<div class="catalog">
  <div *ngFor="let category of (categories$ | async)" [routerLink]="baseUrl + category.path" class="catalog-module">
    <div class="catalog-header">{{category.name}}</div>
    <div class="catalog-body">
      <div class="catalog-img">
        <img [src]="category.image">
      </div>
    </div>
    <div class="catalog-footer">{{category.description}}</div>
  </div>
</div>
import {Component, Input, OnInit} from '@angular/core';
import {CartHomeService} from "../../../catalog/cart-home.service";
import {map} from "rxjs/operators";

@Component({
  selector: 'app-store-catalog',
  templateUrl: './store-catalog.component.html',
  styleUrls: ['./store-catalog.component.scss']
})
export class StoreCatalogComponent implements OnInit {
  categories$;

  @Input() baseUrl = '';

  constructor(private catalogService: CartHomeService) {
  }

  ngOnInit() {
    this.categories$ = this.catalogService.getList().pipe(
      map(x => x.items)
    );
  }
}
Angular CLI: 8.1.0-beta.2
Node: 11.14.0
OS: win32 x64
Angular: 8.1.0-next.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.801.0-beta.2
@angular-devkit/build-angular      0.801.0-beta.2
@angular-devkit/build-ng-packagr   0.801.0-beta.2
@angular-devkit/build-optimizer    0.801.0-beta.2
@angular-devkit/build-webpack      0.801.0-beta.2
@angular-devkit/core               8.1.0-beta.2
@angular-devkit/schematics         8.1.0-beta.2
@angular/cdk                       8.0.1
@angular/cli                       8.1.0-beta.2
@angular/material                  8.0.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   8.1.0-beta.2
@schematics/angular                8.1.0-beta.2
@schematics/update                 0.801.0-beta.2
ng-packagr                         5.3.0
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.34.0

Is this a bug?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:31 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
crisbetocommented, Apr 10, 2020

In general if you see this error, it means that there was some error while we were constructing the template for the first time. We’re currently working on a fix so that these framework errors don’t mask errors in your code.

4reactions
AndrewKushnircommented, Mar 6, 2020

Hi, just want to provide some additional information after further investigation.

It looks like ASSERTION ERROR: Reached the max number of directives error appears because there is some other error (most likely a fatal one) that happened in the app at creation time, but was caught by the error handling logic (presumably in Router). We will look into this more and try to handle this case better and surface relevant error.

As a temporary workaround, please try to find the original error by pausing on all exceptions in browser dev tools, for example as described here. Fixing original error should make this assertion disappear as well.

Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Min and max directives not working as expected in Angular 6
I am trying to deeply understand how to use the "min" and "max" directives in Angular 6, I am aware of the unsupported...
Read more >
Angular Interview Questions — You Must Know (2022) - Medium
We have collected over 200+ Angular Interview Questions from various companies around the world. Learn it, remember it and Crack Angular ...
Read more >
UNPKG - @angular/core
n throw new Error(`ASSERTION ERROR: ${msg}`);\n}\n\nexport function ... directiveStart,\n 'Reached the max number of directives');\n // When the first ...
Read more >
Documentation - The Grails Framework 2.2.5
Grails is a full stack framework and attempts to solve as many pieces of the ... Error reporting and problem diagnosis has been...
Read more >
Problem with Assertion Error : r/Angular2 - Reddit
Hi guys, I hope that you can help me understanding this error. Well, I have a material table with expandable rows, a service...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found