Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local package commands not found #23

Closed
Futskito opened this issue Jul 3, 2020 · 3 comments
Closed

Local package commands not found #23

Futskito opened this issue Jul 3, 2020 · 3 comments

Comments

@Futskito
Copy link

Futskito commented Jul 3, 2020

It's a rare bug that I found today...

If you have any local package registered in your app, and you have i18n installed, laravel seems to be unable to register package commands with the typical code in the package Service Provider:

if($this->app->runningInConsole()){
$this->commands([
MyCommandClass:class,
]);
}

@rafatga
Copy link

rafatga commented Jul 3, 2020

Hi Adam,
My colleague @Futskito and I started using your laravel package to handle the vue translations system. Unfortunately today we ran into an error that made us lose, quite some time and we decided to migrate to another library.

Even though we already moved to another library I will try to explain the error so you can fix it for your current and future users.

In all our projects we divide our code in domains, so we create Modules using composer and laravel.
https://github.com/rafatga/thepinecode-i18n-issue

Issue description
If your project has modules and you register your commands in you module provider you will see that as soon as you install the library (thepinecode /i18n) your commands will be unregistered and you will get the error ( There are no commands defined in the "resourcing" namespace. )

Screen Shot 2020-07-03 at 9 46 16 PM

https://github.com/rafatga/thepinecode-i18n-issue/blob/master/Modules/Admin/Providers/AdminServiceProvider.php
Screen Shot 2020-07-03 at 10 06 41 PM

Before installing (thepinecode /i18n)
As you can see when you write the command (php artisan list) it appears the commands registered (admin:install) & (frontend:install)
Screen Shot 2020-07-03 at 9 44 31 PM

After the installation of (thepinecode /i18n)
After the installation of the library you will see that the commands does not appear registered anymore.
Screen Shot 2020-07-03 at 9 47 29 PM

Bug
The reason why the commands get unregistered is because the library (thepinecode /i18n) executes the command (view:clear) in the function boot of the provider.

Screen Shot 2020-07-03 at 10 16 38 PM

@iamgergo
Copy link
Member

iamgergo commented Jul 4, 2020

@rafatga @Futskito Hi,

Thanks for reporting the issue! I'll revert the view clear command.
It can make local development a bit slower, but there are some interesting conflicts, so we need to fix this.

Thanks again!

@iamgergo
Copy link
Member

iamgergo commented Jul 4, 2020

#18 is reverted now.

@iamgergo iamgergo closed this as completed Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants