Skip to content

[12.x] try-catch all composer package uninstalls#58609

Merged
taylorotwell merged 5 commits intolaravel:12.xfrom
cosmastech:patch-8
Feb 4, 2026
Merged

[12.x] try-catch all composer package uninstalls#58609
taylorotwell merged 5 commits intolaravel:12.xfrom
cosmastech:patch-8

Conversation

@cosmastech
Copy link
Contributor

@cosmastech cosmastech commented Feb 3, 2026

If the uninstall fails, I think we can just proceed forward. This was intended as a convenience thing for cleanup, and it's been a lot of PRs. I am sorry.

To resolve #58599

Following the reproduction steps, the console looks like this (when using the -v flag):

image

Without the -v flag, the exception message isn't written.

cosmastech and others added 5 commits February 3, 2026 16:33
Wrap autoload and application initialization in a try-catch block to handle potential errors during composer events.
Catch Throwable during package uninstall to prevent failure.
Ignore any errors to allow the composer uninstall to complete.
@taylorotwell taylorotwell merged commit b62ad7a into laravel:12.x Feb 4, 2026
70 checks passed
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

Successfully merging this pull request may close these issues.

"pre-package-uninstall" script fails with service providers of non-installed packages - Part 2

2 participants