#Laravel Echo cannot be found warning

8 messages · Page 1 of 1 (latest)

frank lotus
#

Hello everyone!

I'm using Laravel reverb for my project and everything seems to be working fine from making a dispatch to creating the record in the database.
However I am using Laravel livewire as the front end, when listening to the event using On attribute it keeps giving the warning that the Livewire Echo cannot be found.
I did check the Laravel documentation and couldn't reach solution, also there's no specific article about this stuff.

The attribute is like this: #[On'echo:room-name,EventName')

and for later discussion I will like to show the code if needs to be just for the sake of solving this problem.

Thank you very much.

celest owl
frank lotus
celest owl
#

And you did setup echo? Afaik it assumes window.echo to exist

frank lotus
celest owl
#

So what exactly is the error you're seeing?

frank lotus
# celest owl So what exactly is the error you're seeing?

It is a warning to be more specific,
given in livewire;
this is the location where it happens

// js/features/supportLaravelEcho.js
on2("request", ({ options }) => {
if (window.Echo) {
options.headers["X-Socket-ID"] = window.Echo.socketId();
}
});
on2("effect", ({ component, effects }) => {
let listeners2 = effects.listeners || [];
listeners2.forEach((event) => {
if (event.startsWith("echo")) {
if (typeof window.Echo === "undefined") {
console.warn("Laravel Echo cannot be found"); //this is the warning i'm receiving
return;
}
let event_parts = event.split(/(echo:|echo-)|:|,/);
if (event_parts[1] == "echo:") {
event_parts.splice(2, 0, "channel", void 0);
}
if (event_parts[2] == "notification") {
event_parts.push(void 0, void 0);
}
let [
coninue...

frank lotus