@name`inject()` must be called from an injection context
@category runtime
@shortDescription`inject()` must be called from an injection context (a constructor, a factory function or a field initializer)
@description
You see this error when you try to use the `inject()` function outside of the allowed injection context. The injection context is available during the class creation and initialization.
In practice the `inject()` calls are allowed in a constructor, a constructor parameter and a field initializer:
Calls to the `inject()` function outside of the class creation context will result in error. Most notably, calls to `inject()` are disallowed after a class instance was created, in methods (including lifecycle hooks):