Closed candlerb closed 2 years ago
I can't replicate this although sometimes I see something similar happening in Firefox. I will keep trying
Just to bump this. I'm not sure if I should create an additional issue. But I am seeing a failures for buttons as well.
I initally as aiming to use live in one of my projects directly but started facing issues with the client side code which then led to try implementing the simplest example. Following nearly identical process as candlerb, I ran buttons
on chrome and inc
and dec
are throwing error client side:
patch.ts:35 unhandled patch, path target undefined
Safari works without issue.
Thanks for the report, I will see if I can replicate this today.
@AnaelBerrouet I can't replicate this on Chrome or Firefox.
The error you are seeing indicates that the client side is connected to the server, and is receiving patches to the dom. What is is saying is it can't find the node to patch. Do you have any browser extensions installed?
Hey @jfyne thanks for reaching out, I really appreciate it! yea I realized that it was coming through but found it funny that it couldn't patch the node. I definitely do have browser extensions installed. Could you explain what you think is going on with them? Meanwhile I'll try and disable them and run the project again. I'd be interested to understand the issue and to see if there'd be a workaround in the case of people with chrome extensions (there are many of them lol)
The way the current patching logic works relies on the node structure being what the server expects it to be. I wonder about extensions because they can inject extra nodes.
What might be useful is if you could take a screenshot of your DOM structure so I can compare it to what is expected.
I've been thinking about how I can make it less brittle, I have some ideas but it would be still be good to figure out what is going on in your case to help guide any changes that need to be made.
I'll do that today! It's early here so gonna get a coffee first. Also as an aside, thanks for this repo! I started using Phoenix live view and instantly started thinking about how great it would be to do that in golang, and here it is!
Closing this now so as not to spam @candlerb
Environment
go version go1.16.5 darwin/amd64 macOS 10.14.6 chrome 91.0.4472.164 firefox 90.0.1
To replicate
Point browser at http://localhost:8080/clock
What I expected
Incrementing clock
What I saw
With Firefox, everything is OK.
With Chrome, current time is displayed, but does not increment.
tcpdump shows that websocket messages are being sent every second:
I don't see any errors in browser console, although network shows stuck at "101 Switching Proto..."
Additional info
With both Chrome and Firefox, closing the browser tab logs the following at the server side:
I suspect an error message starting with the word "fail" has been put in RawMessage field without being quoted, e.g. see https://play.golang.org/p/w9Vuc8Ko_fN
EDIT: now raised separately as #26