Closed harryqt closed 3 months ago
.config/autoload/middlewares.php contains
.config/autoload/middlewares.php
return [ 'http' => [ \App\Common\Middleware\HandleInertiaMiddleware::class, ], ];
[ERROR] Entry "App\Common\Middleware\HandleInertiaMiddleware" cannot be resolved: Entry "Hyperf\Contract\SessionInterface" cannot be resolved: the class is not instantiable Full definition: Object[Hyperf\Contract\SessionInterface] Full definition: Object[App\Common\Middleware\HandleInertiaMiddleware][21] in /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Exception/InvalidDefinitionException.php [ERROR] #0 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Resolver/ObjectResolver.php(89): Hyperf\Di\Exception\InvalidDefinitionException::create(Object(Hyperf\Di\Definition\ObjectDefinition), 'Entry "App\\Comm...') #1 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Resolver/ObjectResolver.php(52): Hyperf\Di\Resolver\ObjectResolver->createInstance(Object(Hyperf\Di\Definition\ObjectDefinition), Array) #2 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Resolver/ResolverDispatcher.php(51): Hyperf\Di\Resolver\ObjectResolver->resolve(Object(Hyperf\Di\Definition\ObjectDefinition), Array) #3 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Resolver/DepthGuard.php(68): Hyperf\Di\Resolver\ResolverDispatcher->Hyperf\Di\Resolver\{closure}() #4 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Resolver/ResolverDispatcher.php(49): Hyperf\Di\Resolver\DepthGuard->call('App\\Common\\Midd...', Object(Closure)) #5 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Container.php(179): Hyperf\Di\Resolver\ResolverDispatcher->resolve(Object(Hyperf\Di\Definition\ObjectDefinition), Array) #6 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Container.php(72): Hyperf\Di\Container->resolveDefinition(Object(Hyperf\Di\Definition\ObjectDefinition), Array) #7 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/di/src/Container.php(117): Hyperf\Di\Container->make('App\\Common\\Midd...') #8 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/dispatcher/src/AbstractRequestHandler.php(40): Hyperf\Di\Container->get('App\\Common\\Midd...') #9 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/dispatcher/src/HttpRequestHandler.php(27): Hyperf\Dispatcher\AbstractRequestHandler->handleRequest(Object(Hyperf\HttpMessage\Server\Request)) #10 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/dispatcher/src/HttpDispatcher.php(35): Hyperf\Dispatcher\HttpRequestHandler->handle(Object(Hyperf\HttpMessage\Server\Request)) #11 /Users/harry/Projects/hyperf-inertia/vendor/hyperf/http-server/src/Server.php(112): Hyperf\Dispatcher\HttpDispatcher->dispatch(Object(Hyperf\HttpMessage\Server\Request), Array, Object(Hyperf\HttpServer\CoreMiddleware)) #12 [internal function]: Hyperf\HttpServer\Server->onRequest(Object(Swoole\Http\Request), Object(Swoole\Http\Response)) #13 {main}
I have been trying to integrate Hyperf + Inertia + Svelte, do you have any example project?
It failed because it has no hyperf/session package. You can install it separately or upgrade this package to the latest version
.config/autoload/middlewares.php
containsI have been trying to integrate Hyperf + Inertia + Svelte, do you have any example project?