Skip to main content
Version: 0.1.2

Class: CircularDependencyInjectionError

Imported from @react-logic/di

Thrown when a service's constructor injects a token whose construction is already in progress in the same scope — i.e. A injects B injects A.

The error message includes the full injection path that triggered the cycle, so you can see how the loop was reached. Resolve cycles by either inverting a dependency, lazy-injecting via a factory provider that defers the lookup, or splitting a service into two.

Extends​

  • Error

Constructors​

Constructor​

new CircularDependencyInjectionError(type, injectionTreeType, injectorName): CircularDependencyInjectionError

Parameters​

type​

InjectionType<unknown>

injectionTreeType​

InjectionType<unknown>[]

injectorName​

string

Returns​

CircularDependencyInjectionError

Overrides​

Error.constructor