mouyong / webman-laravel

11 stars 4 forks source link

A facade root has not been set 错误 #2

Open maliang opened 1 year ago

maliang commented 1 year ago

按照readme安装后 启动报 A facade root has not been set 错误 路由中 Webman\Route 和 Illuminate\Support\Facades\Route 均无法使用

mouyong commented 1 year ago

是否有修改相关的文件呢,这个问题是因为 laravel 的加载启动顺序导致的。未处理好的情况下,就会导致 facade 找不到对应的声明。

maliang commented 1 year ago

我全新下了webman,然后按照readme 安装 webman-laravel,没做任何修改 在config/route.php 中写路由

Route::get('/', function () {
    return response('cishi');
});

不管use的 Webman\Route 还是 Illuminate\Support\Facades\Route 都会报错 use Webman\Route 会报错 Error: Call to a member function addRoute() on null in /www/webman_laravel/vendor/workerman/webman-framework/src/Route.php:354 use Illuminate\Support\Facades\Route 会报错 RuntimeException: A facade root has not been set. in /www/webman_laravel/vendor/illuminate/support/Facades/Facade.php:335

mouyong commented 1 year ago

你通过这里加一下群,然后找我一下,我远程帮你看看?

https://plugins-world.cn/community/teams.html

mouyong commented 1 year ago

我有项目在使用。之前记得是可以的。