adrianhajdin / project_chat_application

This is a code repository for the corresponding YouTube video. In this tutorial we are going to build and deploy a real time chat application. Covered topics: React.js, Node.js, Express.js, and Socket.io.
https://www.jsmastery.pro
3.95k stars 1.51k forks source link

not working #125

Open parnaz-pirhadi opened 11 months ago

parnaz-pirhadi commented 11 months ago

i have a lot of error : Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://project-chat-application.herokuapp.com/socket.io/?EIO=3&transport=polling&t=OiTBTSl. (Reason: CORS request did not succeed). Status code: (null)

and when i want to chat , nothing happend

venkateshatgit commented 9 months ago

Hi @parnaz-pirhadi I also faced same issue.

Actually in this code there are two phase that is : client & server.

You have to npm start both the folder and change the Endpoint (as shown in image, in Chatjs component)

image

The issue is because the "https://project-chat-application.herokuapp.com/" host might be inactive, that's why it is not accepting response.

for me changing the Endpoint worked, and I came across new bugs!!

Happy coding

Lagnajit09 commented 6 months ago

socket.io has changed its documentation. You can refer to this page https://socket.io/docs/v3/handling-cors/

Or check my repo https://github.com/Lagnajit09/realtime-chat-app.... I have used the latest version and it works perfecttly