django-channels-example icon indicating copy to clipboard operation
django-channels-example copied to clipboard

Uncaught DOMException: An attempt was made to use an object that is not, or is no longer, usable

Open Binit-Dhakal opened this issue 1 year ago • 0 comments

First of all, Thank you for the amazing tutorial. I followed all the instructions in the blog post and found this error(in the heading) in the console when hitting the "send" button in the chat room. I also cloned the error to make sure the error was not because of my mistake, but still got same issue.

I searched online for this error and it points out that this is mainly caused when websocket connection is not established which is the case i can see in my firefox console "Firefox can’t establish a connection to the server at ws://localhost:8000/ws/chat/Test-Room/.".

Also in server log, I can see this error

[31/Dec/2023` 04:47:02] "GET /ws/chat/New-Room/ HTTP/1.1" 404 2231

[31/Dec/2023 04:48:02] code 400, message Bad request version ('È\x04\x16ÊÎwÀÕ±:ÆO*w}9ýùZhÚÊHNq̲\x94\x00"\x13\x01\x13\x03\x13\x02À+À/̨̩À,À0À')

[31/Dec/2023 04:48:02] You're accessing the development server over HTTPS, but it only supports HTTP.
Not Found: /ws/chat/New-Room/

I am a little lost as I have no previous experience with channels and WebSocket in general. Can you please help me with this?

Thank you

Binit-Dhakal avatar Dec 31 '23 04:12 Binit-Dhakal