angular: Cannot read properties of undefined (reading 'producerNode')

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

With new version 16.2.5

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Cannot read properties of undefined (reading 'producerNode')
    at assertConsumerNode (core.mjs:2578:5)
    at producerRemoveLiveConsumerAtIndex (core.mjs:2570:9)
    at consumerDestroy (core.mjs:2515:13)
    at destroyLView (core.mjs:7116:46)
    at ViewContainerRef.remove (core.mjs:24479:13)
    at common.mjs:3143:31
    at DefaultIterableDiffer.forEachOperation (core.mjs:29718:17)
    at NgForOf._applyChanges (common.mjs:3135:17)
    at NgForOf.ngDoCheck (common.mjs:3130:22)
    at callHookInternal (core.mjs:3900:14)
................
ERROR: index [Expected=> 0 < 0 <=Actual]
    at throwError (core.mjs:328:11)
    at assertLessThan (core.mjs:299:9)
    at ViewContainerRef._adjustIndex (core.mjs:24495:13)
    at ViewContainerRef.remove (core.mjs:24469:34)
    at common.mjs:3143:31
    at DefaultIterableDiffer.forEachOperation (core.mjs:29718:17)
    at NgForOf._applyChanges (common.mjs:3135:17)
    at NgForOf.ngDoCheck (common.mjs:3130:22)
    at callHookInternal (core.mjs:3900:14)
    at callHook (core.mjs:3931:9)

Please provide the environment you discovered this bug in (run ng version)

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 16.2.2
Node: 20.6.0 (Unsupported)
Package Manager: npm 9.8.1
OS: darwin x64

Angular: 16.2.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1602.2
@angular-devkit/build-angular      16.2.2
@angular-devkit/build-ng-packagr   0.1002.0
@angular-devkit/core               16.2.2
@angular-devkit/schematics         16.2.2
@angular/cdk                       16.2.4
@angular/cli                       16.2.2
@angular/flex-layout               15.0.0-beta.42
@angular/material                  16.2.4
@angular/material-moment-adapter   16.2.4
@angular/youtube-player            16.2.4
@schematics/angular                16.2.2
rxjs                               7.8.1
typescript                         5.1.6
zone.js                            0.13.3

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 1
  • Comments: 19 (6 by maintainers)

Most upvoted comments

Hi, could you provide a reproduction on Stackblitz ?

Sorry. Its a huge project. I can’t share on Stackblitz. But it is a simple standalone component. Its ChangeDetectionStrategy is onPush and implemented from AfterContentInit, OnInit, OnDestroy.

@JoostK I can confirm the fix has resolved the issue for me.

16.2.6 has been released, could people try updating to see if the issues have been resolved?

@roma2341 unfortunately we had a bug in Angular v16.2.4 impacting signals. This is fixed now in the main branch and the fix will be released this Wed as v16.2.6.

In the meantime you can downgrade to v16.2.3 to check if this is a bug impacting you, as it is impossible to confirm without a reproduction scenario. If you still see problems after downgrade to v16.2.3 / upgrade to v16.2.6 - please share a reproduction scenario in stackblitz - the information we’ve got so far is not enough to diagnose and fix the problem.

This will very likely be fixed by #51722, but a repro would help us validate.