Skip to content

[Queries as signals]: Signal Queries throws console errors when component is rendered as custom element  #54450

@chintankavathia

Description

@chintankavathia

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

core, elements

Is this a regression?

Yes

Description

custom element breaks with console errors when the angular component has contentQuery. This shouldn't happen and it should just always return an empty array in case of contentChildren and undefined in case of contentChild to match with the behavior of existing @ContentChildren, @ContentChild decorators.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-urfw9d?description=An%20angular-cli%20project%20based%20on%20@angular/animations,%20@angular/common,%20@angular/compiler,%20@angular/core,%20@angular/forms,%20@angular/platform-browser,%20@angular/platform-browser-dynamic,%20@angular/router,%20core-js,%20rxjs,%20tslib%20and%20zone.js&file=src%2Fmain.ts,src%2Findex.html,another.component.ts&title=Angular%20Starter

Please provide the exception or error you saw

Cannot read properties of undefined (reading 'propName')
    at Object.Another_ContentQueries [as contentQueries]

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

@angular-devkit/build-angular   17.2.1
@angular-devkit/core            17.2.1
@angular-devkit/schematics      17.2.1
@angular/cdk                    17.2.1
@schematics/angular             17.2.1
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.4

Anything else?

No response

Metadata

Metadata

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimebugcore: queriescore: reactivityWork related to fine-grained reactivity in the core frameworkcross-cutting: signals

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions