logo
podcast Podcast
get help Get Unstuck

Why is Vapor saying my environment is unhealthy?

Especially important to know when doing Laravel version upgrades

Joel Clermont
Joel Clermont
2025-03-07

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.

Toss a coin in the jar if you found this helpful.
Want a tip like this in your inbox every weekday? Sign up below 👇🏼
email
No spam. Only real-world advice you can use.