Documents injecute 1.x · Migrating from 0.x
Skip to content

INJECUTE_INVALID_DEPENDENCY ​

A dependency is not a key, optional(key), collect(tag) or a function.

How to fix it ​

Dependencies are service keys, optional(key), collect(tag) with a tag made by createTag(), or functions that return the value.

Handling it in code ​

ts
import { InjecuteError } from 'injecute';

try {
  // ...
} catch (error) {
  if (error instanceof InjecuteError && error.code === 'INJECUTE_INVALID_DEPENDENCY') {
    // error.message explains what happened; error.path is the resolution chain
  }
}

All error codes

Released under the MIT License.