Closed dlogvin closed 5 months ago
It's weird, because I'm also getting this following error: _laravelEcho.default.private is not a function (it is undefined)
Lmao, I forgot to add pusher inside the echo configuration like this:
new Echo({
broadcaster: 'reverb',
Pusher, // HERE
key: 'my-key',
wsHost: 'localhost',
wsPort: '8080',
wssPort: '8080',
forceTLS: ('http' ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
});
BUT, unfortunately, this is still a problem: _laravelEcho.default.private is not a function (it is undefined)
Nevermind, the setup has to looking like this:
const channels = new Echo({
broadcaster: 'reverb',
Pusher, // HERE
key: 'my-key',
wsHost: 'localhost',
wsPort: '8080',
wssPort: '8080',
forceTLS: ('http' ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
});
channels.private(blah blah blah)
That should do the trick.
Echo Version
^1.16.1
Laravel Version
11.5.0
PHP Version
8.2
NPM Version
10.7.0
Database Driver & Version
No response
Description
When trying to utilize this with React Native, I'm getting the strange error message:
ReferenceError: Property 'Pusher' doesn't exist
I've installed the libraries the following way:
npm i laravel-echo pusher-js
It's kind of weird.
Steps To Reproduce
Start a new expo app
run
npm i laravel-echo pusher-js
And initialize it: