Can I fix "Script @php artisan package:discover returned with error code 1" + "Class not found" without internet connection?
Hello,
I am trying to run composer dump-autoload and I get:
In ProviderRepository.php line 208:
Class 'Facade\Ignition\IgnitionServiceProvider' not found
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Is there a chance to make it work without having internet connection (because I assume I'd need to use composer commands like update which require internet connection
Btw, in ProviderRepository.php at line 208 is a method:
/**
*
* @param string $provider
* @return \Illuminate\Support\ServiceProvider
*/
public function createProvider($provider)
{
return new $provider($this->app)
}
Update: Is it possible that someone in the past tried to change the default error page and messed with vendor and changed something? Or it's something in the composer files?
@Sinnbeck it's weird because the file is there as well, in the root of the src/ folder. It's different from the file in your link but probably because I am working on an old Laravel 6 project
I actually even saw that in vendor/composer/autoload_classmap.php it has the correct path so no idea what else could be the issue besides leaving it as it is
@Ligonsker you might be able to to get through it if you take them one by one, and then remove it afterwards. Just make sure to back up your vendor folder
@Sinnbeck Yes! It worked! finally dump-autoload worked.
So I started adding the missing packages one-by-one and eventually they were only 3:
"facade/ignition", "laravel/ui", "nunomaduro/collision".
By "removing it afterwards" - you mean remove the actual packages from vendor, or just the package I put in dont-discover? Just not sure that, if composer doesn't discover them meaning that they're actually also not in use by the project (I would have gotten the same missing error in the project then?)
any idea what could cause these 3 specific packages to be "missing" even though they're there?
@Sinnbeck thank you! and do you think that even though this workaround works, I can somehow find out what's causing these 3 packages to be missing? Or that's something about composer already and not relevant for here?
But since I don't know exactly what happened here, which one of the above can be the cause? And, since the first solution solved it for me, is it safe to leave these 3 packages in require instead of require-dev?