Skip to content

Error message for NG0303 only mentions decorator-based inputs #62319

@json-derulo

Description

@json-derulo

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

core

Is this a regression?

No

Description

When setting an input via ComponentRef.setInput(), but the given input name is not available on the component, an error is thrown. But the error message seems outdated, it only mentions the decorator-based @Input() and ignores the input() function. This can be confusing for new Angular developers who have never worked with the decorator-based inputs.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Error: NG0303: Can't set value of the 'inputName' input on the 'MyComponent' component.
Make sure that the 'inputName' property is annotated with @Input() or a mapped @Input('inputName') exists.

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

Angular CLI: 20.0.4
Node: 22.17.0
Package Manager: npm 11.4.2
OS: darwin arm64

Angular: 20.0.5
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2000.4
@angular-devkit/core         20.0.4
@angular-devkit/schematics   20.0.4
@angular/build               20.0.4
@angular/cdk                 20.0.4
@angular/cli                 20.0.4
@angular/material            20.0.4
@schematics/angular          20.0.4
rxjs                         7.8.2
typescript                   5.8.3
zone.js                      0.15.1

Anything else?

Affected LOC:

message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions