Build and Deploy a Realtime Chat Application - Socket.io, Node.js, and React.js
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they were following when they ask why their chat app fails to connect, crashes on the server, or breaks after deployment to Heroku.
Recommended by 0 people across 0 different months, 2020 to 2022.
What it is
A nearly two-hour coding tutorial from JavaScript Mastery that builds a full realtime chat app with React on the front end and Node.js with Socket.io on the back end. It covers sending and receiving messages over web sockets and then deploying the finished app.
What people said
Cites user36339 · 2020-11 · Stack Overflow · on “Why is preventDefault() not working in ReactJS properly?”
Ok, I was trying to do it like here: [this video] at 1:14:40. He only writes `e.preventDefault()`, it works out for him, though not for me.
Cites ichater · 2021-01 · Stack Overflow · on “Unable to connect front end to back end while following a tutorial”
I am following this tutorial [this video] (github: [LINK] ) trying to create a real time chat app and I am unable to make a connection and I am unable to find what the issue is especially since my code looks exactly the same as the video. import React, { useState, useEffect } from "react"; enter code hereimport queryString from "query-string"; import io from "socket.io-client"; import "./Chat.css"; let socket; export default function Chat({ location }) { const [name, setName] = useState(""); const [room, setRoom] = useState(""); const ENDPOINT = "localhost:5000"; console.log("logging!"); useEffect(() => { const { name, room } = queryString.parse(location.search); socket = io(ENDPOINT); setRoom(ro
Cites Xaver Drabik · 2021-02 · Stack Overflow · on “WebSocket is closed before the connection is established. Socket.io and React”
I want to make an Chat application with Socket.io and I've followed this tutorial: [this video] . I am using React and Node.js Everything works fine while using it locally and even on different devices on my Network. However if I am hosting my Backend on Heroku it doesn't work. The error Message is: WebSocket connection to 'URL' failed: WebSocket is closed before the connection is established. (URL is the URL of my Backend with the Port). I am using SSL. I've already tried to enable session affinity but it already was enabled. My backend code is: (atleast the code that I think is important to the Problem) const app = express(); const server = http.createServer(app); const io = socketio(server); a
Cites Jatan Shah · 2022-04 · Stack Overflow · on “TypeError: Cannot read property 'room' of undefined from Javascript Mastery's Video”
I am getting this error message, I tried everything, but I cannot understand the problem. This doubt is from Javascript Mastery's chat application video [this video] Error Message: TypeError: Cannot read properties of undefined (reading 'room') at Socket. (C:\Users\Jatan\chat-app\server\index.js:43:20) at Socket.emit (node:events:520:28) at Socket.emitUntyped (C:\Users\Jatan\chat-app\server\node_modules\socket.io\dist\typed-events.js:69:22) at C:\Users\Jatan\chat-app\server\node_modules\socket.io\dist\socket.js:465:39 at processTicksAndRejections (node:internal/process/task_queues:78:11) [nodemon] app crashed - waiting for file changes before starting... Index.js : socket.on('sendMessage', (messa