Inversifyjs: Circular Dependencies Detailed Error

Created on 16 Aug 2016  路  2Comments  路  Source: inversify/InversifyJS

Expected Behavior

I would expect that InversifyJS provides us with the "dependencies path" which leads it to detect the circular dependency.

For instance, if I inject B into A, then C into B and finally A into C, I would expect the following message:

"Error: Circular Dependency Found: A -> B -> C -> A"

Current Behavior

Currently, I am experiencing this message : "Error: Circular Dependency Found Between class A and A".

Context

I am working on a really big app involving injection in a lot of services. This results in having a high dependency tree and thus, in taking a long time to identify the issue.

Your Environment

  • Version used: Inversify 2 RC-10
  • Environment name and version: Chrome 52.0
  • Operating System and version (desktop or mobile): Desktop Windows 7
enhancement

Most helpful comment

Hi @anthonyjlmorel I'm not 100% sure about being able to do that mostly because some browsers throws the stack overflow exception (caused by circular dependencies) in different points during the execution. But this is a nice suggestion so I will try to implement it.

All 2 comments

Hi @anthonyjlmorel I'm not 100% sure about being able to do that mostly because some browsers throws the stack overflow exception (caused by circular dependencies) in different points during the execution. But this is a nice suggestion so I will try to implement it.

Hi @anthonyjlmorel this has now been implemented by #353 I will try to release it tonight I'm closing this issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rashtao picture rashtao  路  3Comments

jshearer picture jshearer  路  4Comments

shevchenkobn picture shevchenkobn  路  3Comments

asykes74 picture asykes74  路  4Comments

remojansen picture remojansen  路  4Comments