angular/packages/core
Sonu Kapoor 4c9afb68a3 fix(core): respect ngSkipHydration on components with projectable nodes in LContainers
When a component is created dynamically via ViewContainerRef.createComponent
and receives projectable nodes (e.g. raw DOM nodes or embedded view root nodes),
applying ngSkipHydration to its host element did not prevent NG0503 from being
thrown during SSR serialization.

The root cause is an asymmetry in the serialization pipeline. For inline child
components, serializeLView already guards the annotateHostElementForHydration
call with a ngSkipHydration attribute check, so the component's lView is never
serialized when hydration is opted out. For components hosted inside an
LContainer (created via ViewContainerRef.createComponent), serializeLContainer
called serializeLView unconditionally — bypassing that guard entirely. When
serializeLView then encountered a projection slot backed by a raw DOM node
array, it threw NG0503 regardless of the ngSkipHydration flag.

The fix adds the same guard inside serializeLContainer before calling
serializeLView: if the child lView belongs to a component whose host element
carries ngSkipHydration, the lView serialization is skipped. This matches the
existing behavior for inline components and allows the documented workaround to
actually work for dynamically created ones.

Fixes #67928
2026-04-29 16:09:14 -07:00
..
global build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
primitives ci: remove remainings of saucelabs tests 2026-04-22 14:41:03 -07:00
resources fix(core): Remove note to skip arrow functions in best practices 2026-01-20 10:42:42 -08:00
rxjs-interop feat(core): allow synchronous values for stream Resources 2026-04-16 00:13:04 +03:00
schematics feat(migrations): model + output migrations 2026-04-28 12:43:55 -07:00
src fix(core): respect ngSkipHydration on components with projectable nodes in LContainers 2026-04-29 16:09:14 -07:00
test feat(compiler): Angular expressions with optional chaining returns undefined 2026-04-28 15:26:53 -07:00
testing refactor(core): Don't throw when there are not async metadata 2026-04-27 17:04:09 -07:00
BUILD.bazel refactor(core): export profile event as enum and move profile_types.ts and framework to shared devtools folder 2025-11-19 15:22:49 -08:00
index.ts refactor: update packages/core:{core,src} to ts_project (#61275) 2025-05-14 12:01:51 +00:00
package.json build: update minimum supported Node.js versions 2026-02-25 07:57:18 -08:00
PACKAGE.md build: format md files 2025-11-06 10:03:05 -08:00
public_api.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
tsconfig-build.json build: migrate more targets of @angular/core to ts_project (#61370) 2025-05-16 11:02:07 +00:00
tsconfig-test.json build: migrate more targets of @angular/core to ts_project (#61370) 2025-05-16 11:02:07 +00:00