I recently helped a client upgrade their Laravel application to a new version.
The tests were passing and everything was working locally, but it failed when trying to deploy to Vapor.
Vapor failed on the task "Ensure Environment is Healthy".
Sentry also reported an unhandled exception: "Class Pusher\Pusher not found".
This project does not use broadcasting at all, and therefore is not using Pusher.
So why was Vapor trying to load this class? It has to do with the default environment variables that Vapor injects automatically.
One of those is to set BROADCAST_DRIVER
to pusher
.
This is why it was looking for that class, and why the deployment was failing.
Once we knew that, the solution was simple: Explicitly set BROADCAST_DRIVER
to null
in the environment to eliminate that default.
Here to help,
Joel
P.S. Are you holding back on an older Laravel version, afraid of what might break if you upgrade? We can help you make the move with confidence.