Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

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)
}
0 likes
18 replies
Sinnbeck's avatar

Sounds like you are using the new error page handler but that it's missing from vendor? Can you check?

1 like
Ligonsker's avatar

@Sinnbeck sure, what is supposed to be the path to it? Couldn't find IgnitionServiceProvider

Ligonsker's avatar

@Sinnbeck Yes it exists

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's avatar

@Ligonsker if they changed stuff in vendor you need an internet connection to correct it

1 like
Ligonsker's avatar

@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

Sinnbeck's avatar

@Ligonsker it's weird then. Sadly it's one of those cases where I would just delete the vendor folder and run composer install

2 likes
Ligonsker's avatar

@Sinnbeck I wish I could :/

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's avatar

@Sinnbeck Haha oh my god it worked but then it gave me:

Class 'Laravel\Ui\UiServiceProvider' not found

So I think there are many more that are "missing"

I think this issue is unsolvable without internet.. something is messed up in composer files

Sinnbeck's avatar

@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

1 like
Ligonsker's avatar

@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?

Ligonsker's avatar

@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?

Sinnbeck's avatar

@Ligonsker you would probably need to recreate the issue and attach xdebug to dig into where it goes wrong. I doubt it's worth the trouble

1 like
Ligonsker's avatar

@Sinnbeck Update!

I saw a comment on SO suggesting to move the packages from require-dev to require. I did it, and it worked!

https://stackoverflow.com/a/59369455/18178584

In the same post, someone suggested it might be related to a bug when updating from composer 1.x to 2.x:

https://stackoverflow.com/a/67847239/18178584

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?

Please or to participate in this conversation.