onix-systems-php / hyperf-inertia

MIT License
2 stars 1 forks source link

PHP Fatal error: Uncaught ErrorException: foreach() argument must be of type array|object, null given in /hyperf-inertia/vendor/hyperf/redis/src/RedisFactory.php:31 #2

Closed harryqt closed 3 months ago

harryqt commented 3 months ago

If Redis client is not selected while creation of project using hyperf-skleton then vendor:publish don't work.

php ./bin/hyperf.php vendor:publish  onix-systems-php/hyperf-inertia
PHP Fatal error:  Uncaught ErrorException: foreach() argument must be of type array|object, null given in /Users/harry/Projects/hyperf-inertia/vendor/hyperf/redis/src/RedisFactory.php:31

It can not find config/autoload/redis.php because it does not exists. But what I don't understand why hyperf invoking redis for vendor publish.

vmikhav commented 3 months ago

@harryqt Unfortunatelly I don't know it as well because this package is not even using redis. Try to update package to 1.0.1 and create a blank redis config

<?php

declare(strict_types=1);

return [];
harryqt commented 3 months ago

This looks like a problem within Hyperf. I will try to dig into it later.

vmikhav commented 3 months ago

Ok. Don't forget to update to 1.0.1 as I fixed some component design issues and disabled integration with core package by default (which is quite useful but might be overwhelming)