AUR0022
The @inject decorator on the target ('xxxx') type 'yyyy' is not supported.
Error message
The @inject decorator on the target ('xxxx') type 'yyyy' is not supported.
Parameters
Target name (string)
Target type (string)
Error explanation
This error occurs when the @inject
decorator is used in a way that is not supported by Aurelia's DI system. For example, applying @inject
to a field, method, or other unsupported target will trigger this error. The @inject
decorator is intended for use on classes and, in some cases, constructor parameters.
Common causes
Using
@inject
on a field, method, or property instead of a class or constructor parameter.Incorrect usage of the decorator in TypeScript or JavaScript code.
Attempting to use
@inject
in a context not supported by Aurelia's DI system.
How to fix
Only use
@inject
on classes or constructor parameters.Review the documentation for correct usage of the
@inject
decorator.Refactor your code to move dependency injection to supported locations (class or constructor).
Debugging tips
Check the stack trace to see where the invalid
@inject
usage occurred.Search your codebase for all usages of
@inject
and verify they are on classes or constructors.If using plugins, try disabling them one at a time to isolate the source.
Last updated
Was this helpful?