最新版的Blade模板报错了

古树

问题描述

illuminate/view 发布了新版本 11.10,导致webman使用Blade时报错

报错信息

ReflectionException: Class "blade.compiler" does not exist in /webman/vendor/illuminate/container/Container.php:904
Stack trace:
#0 /webman/vendor/illuminate/container/Container.php(904): ReflectionClass->__construct('blade.compiler')
#1 /webman/vendor/illuminate/container/Container.php(787): Illuminate\Container\Container->build('blade.compiler')
#2 /webman/vendor/illuminate/container/Container.php(723): Illuminate\Container\Container->resolve('blade.compiler', Array)
#3 /webman/vendor/illuminate/view/ViewServiceProvider.php(168): Illuminate\Container\Container->make('blade.compiler')
#4 [internal function]: Illuminate\View\ViewServiceProvider->Illuminate\View\{closure}()
#5 /webman/vendor/illuminate/view/Engines/EngineResolver.php(55): call_user_func(Object(Closure))
#6 /webman/vendor/illuminate/view/Factory.php(326): Illuminate\View\Engines\EngineResolver->resolve('blade')
#7 /webman/vendor/illuminate/view/Factory.php(288): Illuminate\View\Factory->getEngineFromPath('/Users/yuhengli...')
#8 /webman/vendor/illuminate/view/Factory.php(160): Illuminate\View\Factory->viewInstance('exception.500', '/Users/yuhengli...', Array)
#9 /webman/vendor/jenssegers/blade/src/Blade.php(52): Illuminate\View\Factory->make('exception.500', Array, Array)
#10 /webman/vendor/jenssegers/blade/src/Blade.php(47): Jenssegers\Blade\Blade->make('exception/500', Array, Array)
#11 /webman/vendor/workerman/webman-framework/src/support/view/Blade.php(71): Jenssegers\Blade\Blade->render('exception/500', Array)
#12 /webman/support/helpers.php(201): support\view\Blade::render('exception/500', Array, '', '')
#13 /webman/app/exception/Handler.php(57): view('exception/500', Array)
#14 /webman/vendor/workerman/webman-framework/src/App.php(262): app\exception\Handler->render(Object(support\Request), Object(Illuminate\Database\QueryException))
#15 /webman/vendor/workerman/webman-framework/src/App.php(170): Webman\App::exceptionResponse(Object(Illuminate\Database\QueryException), Object(support\Request))
#16 /webman/vendor/workerman/workerman/Connection/TcpConnection.php(646): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#17 /webman/vendor/workerman/workerman/Events/Select.php(311): Workerman\Connection\TcpConnection->baseRead(Resource id #172)
#18 /webman/vendor/workerman/workerman/Worker.php(1638): Workerman\Events\Select->loop()
#19 /webman/vendor/workerman/workerman/Worker.php(1429): Workerman\Worker::forkOneWorkerForLinux(Object(Workerman\Worker))
#20 /webman/vendor/workerman/workerman/Worker.php(1403): Workerman\Worker::forkWorkersForLinux()
#21 /webman/vendor/workerman/workerman/Worker.php(560): Workerman\Worker::forkWorkers()
#22 /webman/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
#23 /webman/start.php(4): support\App::run()
#24 {main}

Next Illuminate\Contracts\Container\BindingResolutionException: Target class [blade.compiler] does not exist. in /webman/vendor/illuminate/container/Container.php:906
Stack trace:
#0 /webman/vendor/illuminate/container/Container.php(787): Illuminate\Container\Container->build('blade.compiler')
#1 /webman/vendor/illuminate/container/Container.php(723): Illuminate\Container\Container->resolve('blade.compiler', Array)
#2 /webman/vendor/illuminate/view/ViewServiceProvider.php(168): Illuminate\Container\Container->make('blade.compiler')
#3 [internal function]: Illuminate\View\ViewServiceProvider->Illuminate\View\{closure}()
#4 /webman/vendor/illuminate/view/Engines/EngineResolver.php(55): call_user_func(Object(Closure))
#5 /webman/vendor/illuminate/view/Factory.php(326): Illuminate\View\Engines\EngineResolver->resolve('blade')
#6 /webman/vendor/illuminate/view/Factory.php(288): Illuminate\View\Factory->getEngineFromPath('/Users/yuhengli...')
#7 /webman/vendor/illuminate/view/Factory.php(160): Illuminate\View\Factory->viewInstance('exception.500', '/Users/yuhengli...', Array)
#8 /webman/vendor/jenssegers/blade/src/Blade.php(52): Illuminate\View\Factory->make('exception.500', Array, Array)
#9 /webman/vendor/jenssegers/blade/src/Blade.php(47): Jenssegers\Blade\Blade->make('exception/500', Array, Array)
#10 /webman/vendor/workerman/webman-framework/src/support/view/Blade.php(71): Jenssegers\Blade\Blade->render('exception/500', Array)
#11 /webman/support/helpers.php(201): support\view\Blade::render('exception/500', Array, '', '')
#12 /webman/app/exception/Handler.php(57): view('exception/500', Array)
#13 /webman/vendor/workerman/webman-framework/src/App.php(262): app\exception\Handler->render(Object(support\Request), Object(Illuminate\Database\QueryException))
#14 /webman/vendor/workerman/webman-framework/src/App.php(170): Webman\App::exceptionResponse(Object(Illuminate\Database\QueryException), Object(support\Request))
#15 /webman/vendor/workerman/workerman/Connection/TcpConnection.php(646): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#16 /webman/vendor/workerman/workerman/Events/Select.php(311): Workerman\Connection\TcpConnection->baseRead(Resource id #172)
#17 /webman/vendor/workerman/workerman/Worker.php(1638): Workerman\Events\Select->loop()
#18 /webman/vendor/workerman/workerman/Worker.php(1429): Workerman\Worker::forkOneWorkerForLinux(Object(Workerman\Worker))
#19 /webman/vendor/workerman/workerman/Worker.php(1403): Workerman\Worker::forkWorkersForLinux()
#20 /webman/vendor/workerman/workerman/Worker.php(560): Workerman\Worker::forkWorkers()
#21 /webman/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()
#22 /webman/start.php(4): support\App::run()
#23 {main}
464 3 0
3个回答

wanganlin

暂时解决方案

composer require illuminate/view:11.7.0
  • 暂无评论
walkor 打赏

稍后看下

  • 暂无评论
walkor 打赏

测试没有问题,发一个能重现问题的例子吧

  • 暂无评论
×
🔝