angular/packages
Sonu Kapoor 1aeebbe304 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

(cherry picked from commit 4c9afb68a3)
2026-04-29 23:09:18 +00:00
..
animations test: remove duplicate tests 2026-03-11 13:35:26 -07:00
benchpress refactor(benchpress): remove zone-based testing utilities 2026-02-09 07:55:12 -08:00
common refactor(common): fix viewport tests 2026-04-28 16:38:11 -07:00
compiler fix(compiler): let declaration span not including end character 2026-04-28 00:09:19 +00:00
compiler-cli refactor(compiler-cli): remove reflectionhost from environment 2026-04-29 20:36:25 +00:00
core fix(core): respect ngSkipHydration on components with projectable nodes in LContainers 2026-04-29 23:09:18 +00:00
docs/di build: format md files 2025-11-06 10:03:05 -08:00
elements refactor(core): mark VERSION as @__PURE__ for better tree-shaking 2025-11-10 12:04:04 -08:00
examples feat(core): add support for TypeScript 6 2026-02-17 08:40:38 -08:00
forms docs(forms): add NG01902 error reference and link to docs 2026-04-28 19:07:50 +00:00
language-service fix(compiler): let declaration span not including end character 2026-04-28 00:09:19 +00:00
localize fix(localize): validate locale in getOutputPathFn to prevent path traversal 2026-03-30 12:15:31 +02:00
misc/angular-in-memory-web-api build: update peer dependencies and bump version 2026-04-20 09:39:10 -07:00
platform-browser Revert "fix(http): correctly cache blob responses in transfer cache (#67002)" 2026-03-04 17:19:14 +00:00
platform-browser-dynamic refactor(core): mark VERSION as @__PURE__ for better tree-shaking 2025-11-10 12:04:04 -08:00
platform-server fix(core): respect ngSkipHydration on components with projectable nodes in LContainers 2026-04-29 23:09:18 +00:00
private/testing refactor(common): fix viewport tests 2026-04-28 16:38:11 -07:00
router docs(router): Fix method name for retrieving stored handles 2026-04-28 00:03:25 +00:00
service-worker refactor(service-worker): remove unnecessary cast in mock redirect check 2026-03-18 10:26:26 -07:00
ssr/docs build: add node type for api extraction 2026-02-11 13:57:58 -08:00
upgrade test: remove duplicate tests 2026-03-11 13:35:26 -07:00
zone.js fix(zone.js): allow draining microtasks in Promise.then (through flag) 2026-04-15 10:31:33 -04:00
BUILD.bazel build(forms): expose signal forms compat package 2025-11-14 09:23:36 -08:00
circular-deps-test.conf.cjs build: use Node.js built-in TypeScript support for dev-infra scripts 2026-01-02 08:15:40 +01:00
empty.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
goog.d.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
license-banner.txt docs: update copyright year 2026-01-07 12:28:34 -05:00
package.json build: prepare for compiler-cli to be using ts_project (#61181) 2025-05-09 15:59:46 +00:00
README.md build: format md files 2025-11-06 10:03:05 -08:00
system.d.ts refactor: update packages/core:{core,src} to ts_project (#61275) 2025-05-14 12:01:51 +00:00
tsconfig-build.json Revert "refactor(compiler-cli): remove deep imports from compiler-cli (#64732)" 2025-11-06 13:09:01 -08:00
tsconfig-legacy-saucelabs.json feat(core): support TypeScript 5.5 (#56096) 2024-05-29 15:33:33 +02:00
tsconfig-test.json
tsconfig.json feat(compiler-cli): enable type checking of host bindings by default (#63654) 2025-09-09 14:34:29 -07:00
tsec-exemption.json
types.d.ts build: move private testing helpers outside platform-browser/testing (#61472) 2025-05-20 10:00:43 +00:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT