Laravel Echo stops with: Uncaught Options object must provide a cluster
Fix it fast
Most common cause, 1 of 3VITE_PUSHER_APP_CLUSTER is missing, or the code reads a variable without the VITE_ prefix
Define the cluster from your Pusher app's settings and mirror it into a VITE_ variable, as the Laravel broadcasting guide does, and read that VITE_ name in the Echo config.
# .env
PUSHER_APP_CLUSTER="mt1"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
// resources/js/echo.js
window.Echo = new Echo({
broadcaster: 'pusher',
key: import.meta.env.VITE_PUSHER_APP_KEY,
cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
forceTLS: true,
});Short answer
"Uncaught Options object must provide a cluster" comes from pusher-js 8 when its cluster option is undefined. In Laravel 13 Echo setups, VITE_PUSHER_APP_CLUSTER is missing or newer than the last build, the code reads a name without the VITE_ prefix, or Echo uses broadcaster 'pusher' against Reverb. Set the variable and rebuild, or use broadcaster 'reverb'.
Which cause do you have?
Open resources/js/echo.js (or app.js) to see which broadcaster and cluster value Echo gets, then list the VITE_ variables in .env. The pair tells you which cause below applies.
grep -n -A8 "new Echo" resources/js/*.js
grep -n "^VITE_PUSHER\|^VITE_REVERB\|^PUSHER_APP_CLUSTER" .envThen find the line you see in this list and open its fix:
- 1VITE_PUSHER_APP_CLUSTER is missing, or the code reads a variable without the VITE_ prefix
Echo passes cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER (or PUSHER_APP_CLUSTER) and .env has no VITE_PUSHER_APP_CLUSTER line - 2The variable exists, but the bundle was built before it was added
.env is correct, yet the error stays on the deployed site or in a dev server that was started before the change - 3Echo uses broadcaster 'pusher' against Laravel Reverb or another self-hosted server
BROADCAST_CONNECTION=reverb, or a wsHost pointing at your own server, while the Echo config says broadcaster: 'pusher' with no cluster
What does the error look like?
Uncaught Options object must provide a clusterOptions object must provide a cluster
Cause 1 of 3
VITE_PUSHER_APP_CLUSTER is missing, or the code reads a variable without the VITE_ prefix
You seeEcho passes cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER (or PUSHER_APP_CLUSTER) and .env has no VITE_PUSHER_APP_CLUSTER line
Check
Options object must provide a cluster appears here because the cluster value reached pusher-js as undefined. Vite exposes to browser code only the variables whose names start with VITE_; anything else reads as undefined, and since pusher-js 8.0 a missing cluster throws instead of falling back.
grep -n "PUSHER_APP_CLUSTER" .env resources/js/*.jsFix
Define the cluster from your Pusher app's settings and mirror it into a VITE_ variable, as the Laravel broadcasting guide does, and read that VITE_ name in the Echo config.
# .env
PUSHER_APP_CLUSTER="mt1"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
// resources/js/echo.js
window.Echo = new Echo({
broadcaster: 'pusher',
key: import.meta.env.VITE_PUSHER_APP_KEY,
cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
forceTLS: true,
});Verify
Restart the dev server and reload: the error is gone and the browser opens a WebSocket to ws-mt1.pusher.com (your cluster name in place of mt1).
npm run devConfirmed by laravel.com
Cause 2 of 3
The variable exists, but the bundle was built before it was added
You see.env is correct, yet the error stays on the deployed site or in a dev server that was started before the change
Check
Options object must provide a cluster after the variable was added means the running bundle still holds the old value. Vite reads .env files when it starts and writes VITE_ values into the JavaScript at build time, so a change does nothing until the dev server restarts or the assets are built again.
ls -lt .env public/build/manifest.jsonFix
If .env is listed above the manifest, it is newer than the build. Restart npm run dev locally. On the server, rebuild the assets as part of the deploy after .env is in place.
npm run buildVerify
Load the page with the cache disabled; the new asset file name appears in the Network tab and the console stays clean.
ls -lt public/build/assets/ | head -n 5Confirmed by vite.dev
Cause 3 of 3
Echo uses broadcaster 'pusher' against Laravel Reverb or another self-hosted server
You seeBROADCAST_CONNECTION=reverb, or a wsHost pointing at your own server, while the Echo config says broadcaster: 'pusher' with no cluster
Check
Options object must provide a cluster with a self-hosted WebSocket server means Echo builds a plain Pusher client, which still demands a cluster even though wsHost decides where it connects. Echo's reverb broadcaster supplies an empty cluster for you; the pusher broadcaster does not.
grep -n "BROADCAST_CONNECTION\|REVERB_" .envFix
For Reverb, switch the Echo config to the reverb broadcaster with the VITE_REVERB_ variables. For another Pusher-protocol server, keep broadcaster 'pusher' but pass a cluster string together with wsHost; pusher-js uses wsHost when it is set.
window.Echo = new Echo({
broadcaster: 'reverb',
key: import.meta.env.VITE_REVERB_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
});Verify
Start Reverb and the dev server; the browser opens its WebSocket to your own host and port.
php artisan reverb:start
npm run devConfirmed by github.com
How do I stop it coming back?
- Keep every value the front end needs as a VITE_ mirror of the server variable in .env.example, so a fresh clone cannot miss one.
- Build assets in the deploy script after .env is written, never on a developer machine.
- Pin pusher-js and laravel-echo in package.json and read their changelogs before a major upgrade.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine on the same stack: Spotless Laundry, EZ Estimater.