Support the ongoing development of Laravel.io →
Laravel Packages Configuration

Hello,

So, I started playing with Pusher on Laravel 5.6. In the bootstrap.js file where I create the Echo object:

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: process.env.MIX_PUSHER_APP_KEY,
    cluster: process.env.MIX_PUSHER_APP_CLUSTER,
    encrypted: true
});

The object doesn't get the data from the .env file and throws a 4005 pusher error that the path is wrong. If I hard code the values from the .env file right into the instantation of the Echo Object the error goes away.

Am I doing something wrong?

Last updated 3 years ago.
0

I have the same problem

0

I used the normal env variables for pusher. For some reason those two don't work.

0

Your problem is resolved?

0

make sure you set these in you .env

PUSHER_APP_ID=xxx
PUSHER_APP_KEY=xxxx

PUSHER_APP_SECRET=xxxx

PUSHER_APP_CLUSTER=xxxx

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
0

Thanks. Problem solved! gmail sign up

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.