Hello,
I get this error with a fresh install of Lumen (latest version - 5.7.4):
> php artisan ide-helper:generate
In FilesystemManager.php line 160:
Class 'League\Flysystem\Adapter\Local' not found
Any idea why?
No filesystem config options are set.
If I install league/flysystem package then this comes up:
> php artisan ide-helper:generate
In Alias.php line 69:
Class App does not exist
I know this sounds silly, but have you composer installed lol
@rjpounder composer deps are up to date
Before your edit; it could of been a dependency that didn't install correctly and you just missed the message, what happens when you try to tinker? if you can tinker can you new Illuminate\Foundation\Application or new App without any issues?
** Also have you tried deleting your vendor folder and re-composer-installed?
Try for yourself:
composer create-project --prefer-dist laravel/lumen lumen-test && cd lumen-test && composer require --dev barryvdh/laravel-ide-helper && sed -i '' '19i\
\
$app->register(Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);
' artisan && php artisan ide-helper:generate
I got the same error. Solved it by first running:
composer require league/flysystem
Seeing that the error was for aliases, I applied the portion of the docs that referenced aliases and added a config\app.php file that looks like this:
<?php
return [
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
]
];
works!
Thanks for the solution.
Dunno which package changed, but requiring league/flysystem package now seems to work:
composer create-project --prefer-dist laravel/lumen lumen-test && cd lumen-test && composer require --dev barryvdh/laravel-ide-helper league/flysystem && sed -i '' '19i\
\
$app->register(Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);
' artisan && php artisan ide-helper:generate
Still an issue though, you should not have to require another package only for this to work.
Thanks.
Still an issue.
But composer require league/flysystem still works.
Same initial error, but workaround leads to
In AuthManager.php line 97:
Auth driver [api] for guard [api] is not defined.
EDIT: Uncommenting $app->register(App\Providers\AuthServiceProvider::class); in bootstrap/app.php seems to fix it. I'm guessing the ide-helper assumes Auth classes have been registered rather than checking first.
I'm guessing the ide-helper assumes Auth classes have been registered rather than checking first.
Maybe unrelated, but I generally see this particular error when I've some kind of error in the code (shouldn't happen, but does). Like a syntax error in one of the many files or forget to register something correctly.
Lumen 5.8 does not seem to come with flysystem as a default dependency, so needs to be added separately. The local file logging, local file caching, local sessions, I guess don't use flysystem but just go directly to the local filesystem. This is in contrast to laravel.
I got the same issue on a Lumen 5.7 project, composer require league/flysystem --dev fixed it.
I think adding Flysystem to the laravel-ide-helper composer.json would be sufficient, since the package is only used as a development dependency anyway.
But this package doesn't need it for Laravel so IMHO it shouldn't.
Another train of thought: if it's _required_ for Lumen, add it to the Lumen section in the readme. I think in general Lumen users are aware they need to jump through hoops. Support in 3rd party libraries compatible with Lumen will always lack a certain compatibility level because, as of today and to my knowledge, there's no way to properly test it (orchestra/testbench only targets Laravel and, though Lumen comes up every now and then, no concrete plans are happening).
But this package doesn't need it for Laravel so IMHO it shouldn't.
That is because Laravel already has LeagueFlysystem as a dependency.
You are right that it is not specifically developed for Lumen, although I think my solution is pretty elegant. I'm OK with a mention in the readme though.
Another thought -- you could add it to the suggests section of composer.json as well.
But this package doesn't need it for Laravel so IMHO it shouldn't.
Actually, I'm not sure I'm right on this.
Of course this package "somehow" depends on it. It makes use of the Filesystem driver but we don't have an explicit dependency on the 3rd party Local driver.
So _maybe_ actually expressing this dependency somehow makes sense. Though I'm not sure what the proper solution is.
laravel/framework has the explicit dependency on league/flysystem`illuminate/filesystemleague/flysystem🤷♀️
I did the require league/flysystem and then just receive a next error:
In Repository.php line 636:
Call to undefined method IlluminateCacheFileStore::refreshEventDispatcher()
@Alluuu Maybe I miss something, but you can elaborate how this related to ide-helper?
Hey @mfn it was a follow-up to the previous issues, I too am on a fresh lumen install, tried getting ide-helper working, did the league/flysystem require (due to the first already known error) and then after trying to run artisan ide-gelper:generate this was the next new error I received.
Ok, thanks for clarifying. I just found it odd this happens in some Repository.php 🤷♀️ That's why it felt unrelated…
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.
Most helpful comment
I got the same error. Solved it by first running:
composer require league/flysystemSeeing that the error was for aliases, I applied the portion of the docs that referenced aliases and added a
config\app.phpfile that looks like this:works!