Skip to main content
Version: 0.1.2

Class: UnresolvedInjectionError

Imported from @react-logic/di

Thrown when a non-optional token has no provider in the active scope chain (neither the local scope nor any of its ancestors). For class tokens this never fires — they're auto-registered. It only happens with custom InjectionTokens that no <Injector> provided.

Pass { optional: true } to inject() to receive null instead of this error when the token is missing.

Extends​

  • Error

Constructors​

Constructor​

new UnresolvedInjectionError(type, injectorName): UnresolvedInjectionError

Parameters​

type​

InjectionType<unknown>

injectorName​

string

Returns​

UnresolvedInjectionError

Overrides​

Error.constructor