Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting exception #530

Closed
nimasdj opened this issue Oct 29, 2017 · 8 comments
Closed

Getting exception #530

nimasdj opened this issue Oct 29, 2017 · 8 comments
Labels

Comments

@nimasdj
Copy link

nimasdj commented Oct 29, 2017

I am getting this error. Please advise what does it mean and how to fix it?

Fatal error: Uncaught DI\DependencyException: Circular dependency detected while trying to resolve entry 'router' in /vendor/php-di/php-di/src/DI/Container.php:281 Stack trace: #0 /vendor/php-di/php-di/src/DI/Container.php(124): DI\Container->resolveDefinition(Object(DI\Definition\AliasDefinition)) #1 /vendor/php-di/php-di/src/DI/Definition/AliasDefinition.php(63): DI\Container->get('router') #2 /vendor/php-di/php-di/src/DI/Definition/Resolver/SelfResolver.php(34): DI\Definition\AliasDefinition->resolve(Object(DI\Container)) #3 /vendor/php-di/php-di/src/DI/Definition/Resolver/ResolverDispatcher.php(58): DI\Definition\Resolver\SelfResolver->resolve(Object(DI\Definition\AliasDefinition), Array) #4 /vendor/php-di/php-di/src/DI/Container.php(287): DI\Definition\Resolver\ResolverDispatcher->resolve(Object(DI\ in /vendor/php-di/php-di/src/DI/Container.php on line 281

@mnapoli
Copy link
Member

mnapoli commented Oct 29, 2017

Hi, you have a circular dependency in your object graph.

For example you want to inject the router in a service A and also inject service A in the router. That is often because of a root problem in the design of the classes.

@mnapoli mnapoli closed this as completed Oct 29, 2017
@nimasdj
Copy link
Author

nimasdj commented Oct 29, 2017

Would you please give a simple code example to reproduce this error? It helps me debugging.
@mnapoli

@richard4s
Copy link

This problem comes from php-di/slim-bridge v1.0.3.

There is a couple steps you need to run to solve it.

  1. Remove php-di/slim-bridge from Composer
    With this command in your bash: composer remove php-di/slim-bridge

  2. Then you need to pull in the slim-bridge v1.0.2
    With this command in your bash: composer require php-di/slim-bridge 1.0.2

Finally, Build Something awesome.

@mnapoli
Copy link
Member

mnapoli commented Mar 4, 2018

@richard4s suggesting to install an older version is not at all a good solution.

If you have found a bug please open an ticket instead.

@richard4s
Copy link

richard4s commented Mar 4, 2018 via email

@peterhuynhnguyen
Copy link

thank! fix error

@amagrawal
Copy link

This problem comes from php-di/slim-bridge v1.0.3.

There is a couple steps you need to run to solve it.

1. Remove php-di/slim-bridge from Composer
   With this command in your bash: composer remove php-di/slim-bridge

2. Then you need to pull in the slim-bridge v1.0.2
   With this command in your bash: composer require php-di/slim-bridge 1.0.2

Finally, Build Something awesome.

Thanks for the solution.

@sankhacbw
Copy link

This problem comes from php-di/slim-bridge v1.0.3.

There is a couple steps you need to run to solve it.

  1. Remove php-di/slim-bridge from Composer
    With this command in your bash: composer remove php-di/slim-bridge
  2. Then you need to pull in the slim-bridge v1.0.2
    With this command in your bash: composer require php-di/slim-bridge 1.0.2

Finally, Build Something awesome.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants