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

Issue upgrading: Class name must be a valid object or a string in LaravelModulesServiceProvider.php #833

Closed
extricate opened this issue Sep 15, 2019 · 6 comments

Comments

@extricate
Copy link

commented Sep 15, 2019

Hi there, I'm encountering the following issue whilst upgrading to Laravel v6/Laravel-modules v6.:

Upgraded the composer.json to include the latest "nwidart/laravel-modules": "^6.0".

Upon upgrading, after running the composer update I get the following error:
` Symfony\Component\Debug\Exception\FatalThrowableError : Class name must be a valid object or a string

at /vendor/nwidart/laravel-modules/src/LaravelModulesServiceProvider.php:59
55| $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) {
56| $activator = $app['config']->get('modules.activator');
57| $class = $app['config']->get('modules.activators.' . $activator)['class'];
58|

59| return new $class($app);
60| });
61| $this->app->alias(Contracts\RepositoryInterface::class, 'modules');
62| }
63| }

Exception trace:

1 Nwidart\Modules\LaravelModulesServiceProvider::Nwidart\Modules{closure}(Object(Illuminate\Foundation\Application), [])
/vendor/laravel/framework/src/Illuminate/Container/Container.php:800

2 Illuminate\Container\Container::build(Object(Closure))
/vendor/laravel/framework/src/Illuminate/Container/Container.php:682`

Unfortunately, due to this error I'm unable to run the upgrade command. Anybody have any idea on how to successfully upgrade? Thanks in advance.

@nWidart

This comment has been minimized.

Copy link
Owner

commented Sep 15, 2019

Hi,

Did you republish the configuration? If not run the following:

php artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProvider"
@extricate

This comment has been minimized.

Copy link
Author

commented Sep 15, 2019

Hiya nWidart,
Thanks for the swift reply. I've been desperately trying to forcefully republish the config -- however keep running into composer errors. No clue how to circumvent the composer-autoloader from being broken.

@nWidart

This comment has been minimized.

Copy link
Owner

commented Sep 15, 2019

I see, in that case you can compare the original: https://github.com/nWidart/laravel-modules/blob/master/config/config.php

You could copy the whole content and paste it in your config of laravel-modules.

@extricate

This comment has been minimized.

Copy link
Author

commented Sep 15, 2019

Yea I'll just try that for now, thanks -- I'll keep you posted.

@extricate

This comment has been minimized.

Copy link
Author

commented Sep 15, 2019

Manually resetting the config seems to have done the trick, merci!

@extricate extricate closed this Sep 15, 2019
@nWidart

This comment has been minimized.

Copy link
Owner

commented Sep 15, 2019

Awesome! 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.