tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.64k stars 509 forks source link

Not receiving websocket's message in frontend by the listener #550

Open devsafarian opened 3 years ago

devsafarian commented 3 years ago

I have already asked here: https://stackoverflow.com/questions/65026362/laravel-echo-listener-not-working-on-frontend Please take a look.

lc3t35 commented 3 years ago

I had the same issue, workaround downgrade "socket.io-client": "2.3.0" in your package.json works fine. Would appreciate a solution with latest 3.x version of socket.io-client.

Murdock09 commented 3 years ago

Thank you lc3t35. Had the exact same issue, had me looking up and down for a week long. Downgrading indeed fixed it!

sergiuwd commented 3 years ago

I had the same issue, workaround downgrade "socket.io-client": "2.3.0" in your package.json works fine. Would appreciate a solution with latest 3.x version of socket.io-client.

After 3 days of debugging... THIS WORKED! Thank you for posting your solution!

melvin78 commented 3 years ago

Same here downgrading fixed the issue :). I'm using laravel-echo-server and redis as my queue driver

renepardon commented 3 years ago

I had the same issue, workaround downgrade "socket.io-client": "2.3.0" in your package.json works fine. Would appreciate a solution with latest 3.x version of socket.io-client.

After 3 days of debugging... THIS WORKED! Thank you for posting your solution!

Welcome in my club dude! Also 3 wasted days for me ;( Never thought about the socket.io-client downgrade as a solution. Finally private channels work <3

nikitabuida commented 3 years ago

I had the same issue, workaround downgrade "socket.io-client": "2.3.0" in your package.json works fine. Would appreciate a solution with latest 3.x version of socket.io-client.

Oh my, thank you so much! It was driving me nuts late after midnight 🥇

lc3t35 commented 3 years ago

@tlaverdure any update on this issue ? Could you please state to downgrade socket.io-client at 2.3.0 in the Readme : https://github.com/tlaverdure/laravel-echo-server#socketio-client-library ?

jamieleepreece commented 3 years ago

v2.3.0 worked for me! Can't thank you enough for this. Spent a whole week scouring google and trying everything. I've reconfigured my Vagrant, Redis, Echo Server and Echo client how many times! Worst part is that there was no hint, warning or error anywhere in any log file, or in chrome dev tools. I think this issue is quite significant and really needs to be reinforced on the official guide.

lc3t35 commented 3 years ago

Please credit @devsafarian for the finding (on stackoverflow), I just put it back here

Capture d’écran 2021-05-09 à 16 13 47

@tlaverdure could you please just update the Readme ?

jamieleepreece commented 3 years ago

Cheers @devsafarian! Last thing I though of doing was downgrading... If it helps anyone, I was using v4.0. However, from a bit of poking around open issues, it seems v3 onwards is not supported. I was getting a successful WebSocket connection, but the echo server was not logging any connected users. Channel events were being logged, but my 'connected' client was not receiving them. A simple disclaimer on the master readme would help many other people that ended up in the same boat as me. socket.io-client v2.3.0

Alilabib commented 3 years ago

I had the same issue, workaround downgrade "socket.io-client": "2.3.0" in your package.json works fine. Would appreciate a solution with latest 3.x version of socket.io-client.

thank you very much after along time finally a solution @lc3t35

AmirRezaM75 commented 2 years ago

Downgrading fixed my problem but now I have 4 vulnerabilities (2 moderate, 1 high, 1 critical) after npm install socket.io-client@2.3.0 :)

AsadRazaJutt1 commented 2 years ago

Thank you All finally problem solved after 3 days.

quanhvpd00567 commented 2 years ago

@AsadRazaJutt1

I downgrade package socket.io-client@ from 4.0.4 to 2.3.0 but it not working help me

Petryashin commented 2 years ago

Downgrade from 3.* to 2.3.0 has fixed the issue, thanks

bci24 commented 2 years ago

The same problem here. I am using laravel 9.11 with laravel-mix@6.0.43, socket.io-client@4.5.0 and laravel-echo-server@1.6.3

If I downgrade socket.io-client from 4.5.0 to 2.4.0 it works....

I dont think this is ok ... in terms of security

sammyaxe commented 2 years ago

The same problem here. I am using laravel 9.11 with laravel-mix@6.0.43, socket.io-client@4.5.0 and laravel-echo-server@1.6.3

If I downgrade socket.io-client from 4.5.0 to 2.4.0 it works....

I dont think this is ok ... in terms of security

I get Error: Socket.io client not found. Should be globally available or passed via options.client when I downgrade to this version

sammyaxe commented 2 years ago

Downgrade worked for me too, just have to make sure to import io like this:

import io from "socket.io-client";

versus

import { io } from "socket.io-client"; that is used in later versions of socket-io client

marcusblevin commented 1 year ago

Downgrade worked

derciesto commented 1 year ago

Downgrade worked socket.io-client@2.4.0

Tushar-Annexlogics commented 1 year ago

Thank you bros, you saved my time.. it took my half day.

laplandlearner commented 1 year ago

thank you so much

MuriloChianfa commented 1 year ago

Im using laravel 10 and when i downgrade socket.io-client from 4.6.2 to 2.3.0, its works. tnhx.