Skip to content

Angular 20 zoneless: NG0103 endless change notifications when using NgxGantt (especially with virtualScrollEnabled) #613

@siddharthpatel04

Description

@siddharthpatel04

Hi 👋
First of all, thank you for maintaining @worktile/gantt.

I’m currently migrating an application to Angular 20 with zoneless change detection and am running into a stabilization issue that appears to be caused by NgxGantt’s internal change-detection behavior.

Environment

  • Angular: 20.2.x
  • @worktile/gantt: 20.0.0
  • Change detection: Zoneless (provideZonelessChangeDetection())
  • Component strategy: ChangeDetectionStrategy.OnPush
  • Zone.js: disabled
  • NGXS: used, but issue reproduces without NGXS involvement

Problem

When NgxGantt is rendered in a zoneless Angular app, Angular throws:

NG0103: Angular could not stabilize because there were endless change notifications within the browser event loop.

Stack trace consistently shows:

@worktile_gantt.js → ViewRef.markForCheck()
→ ChangeDetectionScheduler.notify()
→ endless notifications

This happens even when:

  • No manual detectChanges() is used
  • No afterNextRender, microtasks, or effects are involved
  • No viewChange output is subscribed to
  • Inputs (items, viewType) are stable references

The issue becomes immediate and consistent when:

<ngx-gantt [virtualScrollEnabled]="true" ...>

Disabling virtualScrollEnabled makes the error disappear.

Observed Behavior

  • NgxGantt appears to emit continuous internal notifications (likely from ResizeObserver / scroll observers).

  • Each notification triggers markForCheck().

  • In Angular 20 zoneless, this causes Angular to detect a non-stabilizing event loop and throw NG0103.

  • With Zone.js enabled, this does not throw, suggesting NgxGantt currently relies on zone-based task coalescing.

Expected Behavior

  • NgxGantt should stabilize in zoneless Angular apps, or

  • At minimum, documentation should clarify whether:

    1. Angular zoneless is supported
    2. virtualScrollEnabled is compatible with zoneless
    3. Detached or zone-free change detection is expected to work

Minimal Reproduction (conceptual)

bootstrapApplication(AppComponent, {
  providers: [provideZonelessChangeDetection()]
});
<ngx-gantt
  [items]="items"
  [viewType]="viewType"
  [virtualScrollEnabled]="true">
</ngx-gantt>

This consistently triggers NG0103 in Angular 20.

Questions for Maintainers

  1. Is Angular zoneless change detection officially supported in NgxGantt v20?
  2. Is virtualScrollEnabled expected to work without Zone.js?
  3. Are there plans to throttle or coalesce internal markForCheck() calls to support zoneless mode?
  4. Would you accept a PR that guards observer emissions for zoneless compatibility?

Additional Notes

Angular 20 enforces stabilization guarantees more strictly than previous versions, which exposes patterns that previously worked silently with Zone.js.

This issue may affect other users as Angular zoneless adoption increases.

Thank you for your time and for the library 🙏
Happy to help with debugging or a reproduction repo if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions