Skip to content

question: How to debug circular dependency injections ? #1185

Open
@codemasternode

Description

@codemasternode

Hi, i'm getting errors when modify my code (it has a lot of imports, injections etc., so i don't put any code up here). It's probably issue with circular injection but it' quite hard to catch the real problem. Error that i'm getting is:

RangeError: Maximum call stack size exceeded
at OrdinaryHasOwnMetadata (/web/node_modules/reflect-metadata/Reflect.js:592:40)
at OrdinaryGetMetadata (/web/node_modules/reflect-metadata/Reflect.js:601:26)
at Reflect.getMetadata (/web/node_modules/reflect-metadata/Reflect.js:357:20)
at ContainerInstance.getServiceValue (/web/node_modules/src/container-instance.class.ts:276:44)
at ContainerInstance.get (/web/node_modules/src/container-instance.class.ts:54:36)
at Object.value (/web/node_modules/src/decorators/inject.decorator.ts:38:34)
at /web/node_modules/src/container-instance.class.ts:331:45
at Array.map (<anonymous>)
at ContainerInstance.initializeParams (/web/node_modules/src/container-instance.class.ts:314:23)
at ContainerInstance.getServiceValue (/web/node_modules/src/container-instance.class.ts:277:27)

Do you guys have an idea how to break up this issue ? Such errors appear from time to time when i'm using typedi, i always spend a lot of time modyfing order of imports, injections etc. This errors doesn't provide any useful information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionQuestions about the usage of the library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions