I don’t have a solution but hopefully this adds to the discussion and someone with more Laravel skills can pick it up. It may also be that the problem is irrelevant since there always seem to be an underlying problem that needs to be fixed regardless.
I run into basically the same error:
Fatal error: Uncaught Exception: Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable.
in /home/vagrant/code/web/app/themes/theme-name/vendor/illuminate/container/Container.php on line 1089
when WP_DEBUG and WP_DEBUG_DISPLAY is set to true. The culprit in my case is Corcel and more specifically this line. Having said that, the originating error is probably irrelevant and the final error that we all have in common will arise as soon as something goes wrong when booting the app. Of course, the originating errors should be fixed as well but let’s deal with the error we all have in common here.
Comparing the debug.log in Twansparants post with mine, the common culprit seems to be the function report() which, in our stacks, are called by skipProvider() where ExceptionHandler::class seems to be Illuminate\Contracts\Debug\ExceptionHandler which is an interface which, I assume, is what is somehow causing the “is not instantiable” error.
This is about as far as I can go before loosing grip on what the code actually does (even though I am reading up on Laravel). Googling “illuminate Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable” renders some results but I can not see that any of them has a solution that is applicablie to my (our?) cases.
I am running
- Sage 10
- Acorn 2.1.2 (tried downgrading but no luck)
- PHP 8.0 (both on the server and when runnnng composer)
I have deleted vendor folders, run composer dump-autoload
, deleted the cache-folder and all other things I can come up with to no avail.
Bonus: By doing dd($e);
on line 330 and 398 in vendor/roots/acorn/src/Roots/Acorn/Application.php we can get more details on the originating error. In my case it is “Skipping provider [Corcel\Laravel\CorcelServiceProvider] because it requires a dependency that cannot be found.” and “Target class [auth] does not exist.”.
My error call stack for reference:
Illuminate\Container\Container::notInstantiable()
app/themes/theme-name/vendor/illuminate/container/Container.php:886
Illuminate\Container\Container::build()
app/themes/theme-name/vendor/illuminate/container/Container.php:758
Illuminate\Container\Container::resolve()
/home/vagrant/code/vendor/roots/acorn/src/Illuminate/Foundation/Application.php:851
Illuminate\Foundation\Application::resolve()
app/themes/theme-name/vendor/illuminate/container/Container.php:694
Illuminate\Container\Container::make()
/home/vagrant/code/vendor/roots/acorn/src/Illuminate/Foundation/Application.php:836
Illuminate\Foundation\Application::make()
/home/vagrant/code/vendor/roots/acorn/src/Illuminate/Foundation/helpers.php:119
app()
/home/vagrant/code/vendor/roots/acorn/src/Illuminate/Foundation/helpers.php:629
report()
/home/vagrant/code/vendor/roots/acorn/src/Roots/Acorn/Application.php:397
Roots\Acorn\Application::skipProvider()
/home/vagrant/code/vendor/roots/acorn/src/Roots/Acorn/Application.php:330
Roots\Acorn\Application::bootProvider()
/home/vagrant/code/vendor/roots/acorn/src/Illuminate/Foundation/Application.php:905
Illuminate\F\Application::Illuminate\F\{closure}()
array_walk()
/home/vagrant/code/vendor/roots/acorn/src/Illuminate/Foundation/Application.php:906
Illuminate\Foundation\Application::boot()
/home/vagrant/code/vendor/roots/acorn/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17
Illuminate\F\B\BootProviders::bootstrap()
/home/vagrant/code/vendor/roots/acorn/src/Illuminate/Foundation/Application.php:237
Illuminate\Foundation\Application::bootstrapWith()
/home/vagrant/code/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php:208
Roots\Acorn\Bootloader::app()
/home/vagrant/code/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php:181
Roots\Acorn\Bootloader::__invoke()
wp-includes/class-wp-hook.php:307
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:331
WP_Hook::do_action()
wp-includes/plugin.php:476
do_action()
wp-settings.php:576
require_once()
wp-config.php:9
require_once()
wp-load.php:55
require_once()
wp-admin/admin.php:34
require_once()