LiveComponent crashing on fast key inputs

Hi there! I’m seeing frequent socket (term?) crashes in a new LiveView component. It’s pretty boring, just some input tags and simple validation (no DB queries or anything). I’m on Phoenix 1.7.14.

Console log:

phx-F_Y0PgAX2pTMWzbH update:  - 
phx-F_Y0PgAX2pTMWzbH error: view crashed - undefined

The first line is the update object, which looks fine (not sure what exactly I’d look for, though). The second line is coming from what looks like a generic error handler in my app.js (the channel onError method?), so not pasting it here.

This only happens in text inputs when I type quickly. And that’s only locally (running the server in a devcontainer, so Docker, if that helps). I haven’t seen this behavior in production. When I type slowly (hunt and peck), everything seems fine. On the server side, I’m not seeing any errors, just a new connection after those console errors in the browser.

16:35:53.827 [debug] HANDLE EVENT "validate" in AiCoachWeb.VideoLive.Show
  Component: AiCoachWeb.VideoLive.FormComponent
  Parameters: %{"_target" => ["video", "name"], "video" => %{"name" => "aaaaaaaa"}}
16:35:53.831 [debug] Replied in 5ms
16:35:54.157 [info] CONNECTED TO Phoenix.LiveView.Socket in 34µs
  Transport: :longpoll
  Serializer: Phoenix.Socket.V2.JSONSerializer
  Parameters: %{"_csrf_token" => "REDACTED", "_live_referer" => "undefined", "_mounts" => "2", "_track_static" => %{"0" => "http://localhost:4000/assets/app.css", "1" => "http://localhost:4000/assets/app.js"}, "vsn" => "2.0.0"}

This isn’t the end of the world, but it’s pretty annoying. Also makes me concerned I have a bug somewhere.

Any debugging suggestions or ideas on squashing this?

Thanks!

Another datapoint: I also get a view crash when I close out the modal for this and another form component on the same LiveView. Not sure what would be relevant to share, but that happens every time (same undefined error after an update event in the console). Maybe unrelated?

So after a server restart (just exiting and re-running iex -S mix phx.server) I’m not seeing this any more :confused:

I’d still be appreciative for debugging tips the next time this happens. Thanks!