Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Angular 19] injectStore() runs before input signals are set. #1387

Open
JulienLecoq opened this issue Apr 7, 2025 · 0 comments
Open

[Angular 19] injectStore() runs before input signals are set. #1387

JulienLecoq opened this issue Apr 7, 2025 · 0 comments

Comments

@JulienLecoq
Copy link

Describe the bug

injectStore() runs before input signals are set which makes it throws an error at runtime if the form is provided as an input signal.

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

Your minimal, reproducible example

https://codesandbox.io/p/devbox/q9w9mv

Steps to reproduce

Open the shared link and see the error in the web dev tools.

The error is caused by the following code:

isValid = injectStore(
    this.form(),
    (state) => state.fieldMeta[this.name()].errors.length === 0
  );

In the component: FirstNameComponent

Expected behavior

The injectStore should call the business logic after input signals are set like Angular Query does.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: MacOS
  • Browser: Safari

TanStack Form adapter

None

TanStack Form version

@tanstack/angular-form v1.3.0

TypeScript version

v5.8.3

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant