-
Notifications
You must be signed in to change notification settings - Fork 11.3k
PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php:933 #26874
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
Comments
@desertnightsky thinks for your reply. sorry i don't understand。 getMenus() return Collection (use |
Heya, unfortunately we don't support this version anymore. Can you please try to upgrade to the latest version and see if your problem persists? If so feel free to reply and we'll try to have a look. |
@driesvints can you clarify... the version of what is not supported? Upgrade what to the latest? I've also got this issue on Laravel 5.6, PHPUnit 7.2. |
@anthonygore we don't support 5.6 anymore: https://laravel.com/docs/5.7/releases#support-policy |
Ah okay, thanks |
@anthonygore did upgrading Laravel fix it? |
I can't remember, sorry! But I'm still at Laravel 5.6 so I must have found another solution |
laravel 5.7 and 5.8 have this problem too |
Hi, did anyone fixed this issue in Laravel 5.6 with PHP 7.2? I have an interface which is being used in a constructor and that is causing this error. I have read that adding your class in config/app.php will resolve this error but how can we add interface in config/app.php?
|
any solution for this issue yet? , working with Laravel 5.8 and php 7.3.6
|
laravel: 5.8.21 i'm getting this error (after adding https://github.com/sebastiaanluca/laravel-auto-morph-map via composer). when i run
|
laravel 5.8 Problem persists.
|
This is still an issue on Laravel 6.0 (PHP 7.2, PHPUnit 8.3.5) |
Auch, last comment 2 hours ago. |
How come this got closed when error still occurs in 5.8? Can you reopen this issue @driesvints please? |
hey, 2k20 still not fixed, any hint? |
I've seen this particular error in strange cases a few times. They always "went" away after some code was fixed. So this is very unspecific but I've seen cases where code had an error, like a PHPUnit listener had a typo or something, and the actual error was overshadowed by this one. What helped me is: debugging. I can only recommend stepping through your code and trying to pinpoint when it starts to throw the exceptions, that's how I found some bugs (in my / other, not Laraval) code. I'll try to remember when I encounter it the next time to try to figure out what is particularly overshadowing here. Maybe it's a problem with the exception handler/the debug component, a combination of thereof, etc. HTH |
I'm having this same issue but odly only when I run All "Report test execution progress in TestDox format" does is display the output in a different format. Which is confusing. I'm recently moved to a new laptop using Laravel Valet after previously using Homestead (which worked perfectly) so it may be a setup issue. |
Similar here. |
When I delete setUp() function from my test, there is no problem anymore. Even with empty setUp() there is the error. |
That makes complete sense. You need to be calling |
Wow, you're right. Such a stupid mistake. Thank you very much! |
This might not help, but this "PHP Fatal error" error message (or something like it) was happening for me when I was running some Laravel project (Laravel 5.8) tests with PHPUnit (PHPUnit 7.5.20) using a service account user. Something that resolved this issue for me involved deleting the following PHPUnit cache file and then running the phpunit tests again: Hope that helps! |
That was helpful enough, thanks! The problem was I tried to run tests inside container and user had no permissions to create .phpunit.result.cache, so |
@trckster Glad to hear that the earlier post was kind of helpful! After seeing your post, I wonder if I also was running into a permissions issue with that cache file at the time. Thanks for taking the time to post about your situation, too! |
php 7.2
laravel 5.6
phpunit 7.4
test_code
public function testGetMenusTwoRolesHaveRepeatMenus()
{
$user = factory(User::class)->create();
$role0 = factory(Role::class)->create();
$role1 = factory(Role::class)->create();
PHPUnit 7.4.5 by Sebastian Bergmann and contributors.
E.......... 11 / 11 (100%)
Time: 12.36 seconds, Memory: 6.00MB
There was 1 error:
PHPUnit\Framework\Exception: PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php:933
Stack trace:
#0 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(773): Illuminate\Container\Container->notInstantiable('Illuminate\Cont...')
ReflectionException #1 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(646): Illuminate\Container\Container->build('Illuminate\Cont...')
Fix Fatal error on Class 'Illuminate\Filesystem' load #2 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(601): Illuminate\Container\Container->resolve('Illuminate\Cont...', Array)
Migration doesn't account for prefix when checking if migration table exists [bug] #3 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->make('Illuminate\Cont...', Array)
Update src/Illuminate/Events/Dispatcher.php #4 /home/vagrant/code/portal/backend/vendor/laravel/framework/sr in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 933
Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php:933
Stack trace:
#0 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(773): Illuminate\Container\Container->notInstantiable('Illuminate\Cont...')
ReflectionException #1 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(646): Illuminate\Container\Container->build('Illuminate\Cont...')
Fix Fatal error on Class 'Illuminate\Filesystem' load #2 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(601): Illuminate\Container\Container->resolve('Illuminate\Cont...', Array)
Migration doesn't account for prefix when checking if migration table exists [bug] #3 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->make('Illuminate\Cont...', Array)
Update src/Illuminate/Events/Dispatcher.php #4 /home/vagrant/code/portal/backend/vendor/laravel/framework/sr in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 933
PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php:933
Stack trace:
#0 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(773): Illuminate\Container\Container->notInstantiable('Illuminate\Cont...')
ReflectionException #1 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(646): Illuminate\Container\Container->build('Illuminate\Cont...')
Fix Fatal error on Class 'Illuminate\Filesystem' load #2 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(601): Illuminate\Container\Container->resolve('Illuminate\Cont...', Array)
Migration doesn't account for prefix when checking if migration table exists [bug] #3 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->make('Illuminate\Cont...', Array)
Update src/Illuminate/Events/Dispatcher.php #4 /home/vagrant/code/portal/backend/vendor/laravel/framework/sr in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 933
Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable. in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php:933
Stack trace:
#0 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(773): Illuminate\Container\Container->notInstantiable('Illuminate\Cont...')
ReflectionException #1 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(646): Illuminate\Container\Container->build('Illuminate\Cont...')
Fix Fatal error on Class 'Illuminate\Filesystem' load #2 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php(601): Illuminate\Container\Container->resolve('Illuminate\Cont...', Array)
Migration doesn't account for prefix when checking if migration table exists [bug] #3 /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734): Illuminate\Container\Container->make('Illuminate\Cont...', Array)
Update src/Illuminate/Events/Dispatcher.php #4 /home/vagrant/code/portal/backend/vendor/laravel/framework/sr in /home/vagrant/code/portal/backend/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 933
The text was updated successfully, but these errors were encountered: