angular: App With Incremental Hydration Randomly throwing Error on Client Side navigation after upgrading to 19.0.0-rc.1: Cannot read properties of null (reading 'lView')

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

core

Is this a regression?

Yes

Description

After upgrading to 19.0.0-rc.1, applicaiton with Incremental Hydration ranomly throws below error on client side navigation:

ERROR TypeError: Cannot read properties of null (reading 'lView')
    at triggerAndWaitForCompletion (core.mjs:23653:53)
    at core.mjs:37397:9
    at Generator.next (<anonymous>)
    at chunk-4MWRP73S.js?v=556a462a:76:61
    at new ZoneAwarePromise (zone.js:2702:25)
    at __async (chunk-4MWRP73S.js?v=556a462a:60:10)
    at fetchAndRenderDeferBlock (core.mjs:37396:53)
    at core.mjs:22572:11
    at Generator.next (<anonymous>)
    at chunk-4MWRP73S.js?v=556a462a:76:61
var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};

Its not component specific and occurs randomly on any component which is using defer block.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

ERROR TypeError: Cannot read properties of null (reading 'lView')
    at triggerAndWaitForCompletion (core.mjs:23653:53)
    at core.mjs:37397:9
    at Generator.next (<anonymous>)
    at chunk-4MWRP73S.js?v=556a462a:76:61
    at new ZoneAwarePromise (zone.js:2702:25)
    at __async (chunk-4MWRP73S.js?v=556a462a:60:10)
    at fetchAndRenderDeferBlock (core.mjs:37396:53)
    at core.mjs:22572:11
    at Generator.next (<anonymous>)
    at chunk-4MWRP73S.js?v=556a462a:76:61

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

Angular CLI: 19.0.0-rc.1 Node: 20.12.2 Package Manager: npm 10.6.0 OS: win32 x64

Angular: 19.0.0-rc.1 … animations, cdk, cli, common, compiler, compiler-cli, core … forms, google-maps, material, platform-browser … platform-browser-dynamic, platform-server, pwa, router … service-worker, ssr

Package Version

@angular-devkit/architect 0.1900.0-rc.1 @angular-devkit/build-angular 19.0.0-rc.1 @angular-devkit/core 19.0.0-rc.1 @angular-devkit/schematics 19.0.0-rc.1 @angular/fire 18.0.1 @schematics/angular 19.0.0-rc.1 rxjs 7.8.1 typescript 5.6.3 zone.js 0.15.0

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (17 by maintainers)

Most upvoted comments

This is now fixed in RC2. Thanks for the report!

Yes its inside an @if block.

I have managed to replicate the hydration issue here. I’ll see what I can do for a fix.