NG0950 Angular Origin: On your device Angular 17.1+ Last updated 15 Oct 2026

Angular: NG0950: Input is required but no value is available yet (input.required / viewChild.required)

A required signal input or query was read before Angular set it — in the constructor or too early in the lifecycle.

Exact message you may see NG0950: Input is required but no value is available yetInput is required but no value is available yetNG0951: Child query result is required but no value is available
Seen on: Angular TypeScript

Meaning

input.required<T>() (and viewChild.required, contentChild.required) throw NG0950 / NG0951 if read before a value exists. Read them in ngOnInit or later, inside computed/effect, or in the template. In tests, set the input with fixture.componentRef.setInput(...) before the first detectChanges.

Common causes

  • Reading this.name() in the constructor or a field initialiser that runs immediately
  • Parent did not pass the required input (but the compiler is bypassed or the component is created dynamically)
  • Test created the component without setting required inputs
  • Reading a required view query before the view exists (NG0951)
  • Dynamic component creation without setInput

⚡ Quick fix

  1. Read the input inside computed(), effect(), the template, or after init
  2. In tests: fixture.componentRef.setInput('name', 'Ada') before detectChanges()
  3. Use a non-required input with a default if the value can be missing

Detailed fix by platform

Angular

  1. fullName = computed(() => ${this.first()} ${this.last()}); instead of reading signals in the constructor
  2. Dynamic: ref.setInput('id', 7)

Code examples

Read after init

typescript
export class UserCardComponent {
  user = input.required<User>();
  title = computed(() => this.user().name);          // computed reads lazily: OK
  // constructor() { console.log(this.user()); }      // NG0950: nothing set yet
}
// test: fixture.componentRef.setInput('user', { name: 'Ada' }); fixture.detectChanges();

How to diagnose

  1. Timing — Where is the input read?
  2. Parent — Is the required input bound?
  3. Test — setInput before detectChanges?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Cannot find control with name — Angular: Error: Cannot find control with name: 'email' (reactive forms) (Angular)Cannot find control w…Could not find the builder's node package — Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json' (Angular)Could not find the bu…exceeded maximum budget — Angular build: Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 120.00 kB with a total of 1.12 MB (Angular)exceeded maximum budg…NG0203 — Angular: NG0203: inject() must be called from an injection context such as a constructor, a factory function, a field initializer or a function used with runInInjectionContext (Angular)NG0203NG0600 — Angular: NG0600: Writing to signals is not allowed in a computed or an effect by default (Angular)NG0600Schema validation failed with the following errors — Angular CLI: Schema validation failed with the following errors: Data path "" must NOT have additional properties(xyz) (Angular)Schema validation fai…ViewChild is undefined — Angular: TypeError: Cannot read properties of undefined (reading 'nativeElement') — @ViewChild used in ngOnInit (Angular)ViewChild is undefinedNG0950

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.