【发布时间】:2020-11-29 19:05:18
【问题描述】:
- Laravel 版本:7.23.0
- PHP 版本:7.4.8
- 数据库驱动和版本:MySQL v8.0.21
由于当前的漏洞(https://blog.laravel.com/laravel-cookie-security-releases),今天早上我将 Laravel 升级到了 7.23.0 版本。但现在每个 Artisan Command 都会收到以下错误消息:
php artisan package:discover --ansi
TypeError
Illuminate\Container\Container::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
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Facade\Ignition\IgnitionServiceProvider))
+5 vendor frames
18 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
由于我认为这将是一个更明显的错误,并且我在 GitHub 上没有发现问题,所以我没有打开新问题并在这里寻求帮助 :)
但是,我真的不知道究竟是什么导致了这个问题。
【问题讨论】:
-
你可以检查这个github.com/laravel/framework/pull/33539 我认为你还需要显示完整的堆栈跟踪,你还需要确保你的外观/点火版本
-
尝试删除
bootstrap/cache/文件并更新作曲家