Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Signal Queries are populated before the input have been set on the components #59067

Copy link
Copy link
Open
@csisy-bt4w

Description

@csisy-bt4w
Issue body actions

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

Don't known / other

Is this a regression?

Yes

Description

Just updated to Angular v19 and started to experience an error. Created an example with as minimal code as possible. Unfortunately it doesn't make too much sense without additional context, but it is what it is.

So the setup is the following:

  • We have a directive that has a required input (ModelDirective)
  • We have a component that queries a ModelDirective and uses its required input (FormFieldComponent)
  • We also need to turn that input signal into an rxjs observable (for reasons that is not obvious by the example)

The problem is observed within the toObservable but only if the queried directive is created dynamically within a dynamically created component. If you run the example, you can see that the input is actually set properly - if we directly use the computed signal, its value is successfully displayed. However, once we try to read the observable's value, an error is thrown.

If, however, the directive or the owning component is available without any condition, everything works fine (there is a commented line in the example template).

This setup was working fine in Angular v18.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-vjskep?file=src%2Fmain.ts

Please provide the exception or error you saw

ERROR RuntimeError: NG0950: Input is required but no value is available yet.

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

Angular CLI: 19.0.3
Node: 20.11.1
Package Manager: npm 10.2.4
OS: win32 x64

Angular: 19.0.3
... animations, cli, common, compiler, compiler-cli, core
... localize, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1800.3
@angular-devkit/build-angular   19.0.3
@angular-devkit/core            18.0.3
@angular-devkit/schematics      18.2.11
@angular/cdk                    19.0.2
@schematics/angular             18.2.11
ng-packagr                      19.0.1
rxjs                            7.8.1
typescript                      5.5.4
zone.js                         0.15.0

Anything else?

No response

Metadata

Metadata

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.