skip to Main Content
  • Laravel Version: 7.23.0
  • PHP Version: 7.4.8
  • Database Driver & Version: MySQL v8.0.21

This morning I upgraded Laravel to version 7.23.0 due to the current vulnerability (https://blog.laravel.com/laravel-cookie-security-releases). But now I get the following error message with every Artisan Command:

php artisan package:discover --ansi

   TypeError 

  IlluminateContainerContainer::bind(): Argument #2 ($concrete) must be of type Closure|string|null

  at vendor/laravel/framework/src/Illuminate/Container/Container.php:238
    234|         // bound into this container to the abstract type and we will just wrap it
    235|         // up inside its own Closure to give us more convenience when extending.
    236|         if (! $concrete instanceof Closure) {
    237|             if (! is_string($concrete)) {
  > 238|                 throw new TypeError(self::class.'::bind(): Argument #2 ($concrete) must be of type Closure|string|null');
    239|             }
    240| 
    241|             $concrete = $this->getClosure($abstract, $concrete);
    242|         }

      +11 vendor frames 
  12  [internal]:0
      IlluminateFoundationApplication::IlluminateFoundation{closure}(Object(FacadeIgnitionIgnitionServiceProvider))

      +5 vendor frames 
  18  artisan:37
      IlluminateFoundationConsoleKernel::handle(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))

Since I think this would be a more noticeable bug, and I haven’t found an issue on GitHub, I didn’t open a new one and ask for help here 🙂

However, I don’t really have any idea what exactly might be causing the problem.

2

Answers


  1. Chosen as BEST ANSWER

    Thanks to Abdel-aziz hassan for the link (https://github.com/laravel/framework/pull/33539).

    I found out that facade/ignition was on an old version. I updated it and now it works.

    Thanks guys!


  2. In my case using instance instead of bind helps me.

    $app->instance(Service::class, $serviceInstance)
    

    instead

    $app->bind(Service::class, $serviceInstance)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search