[Live Component] Error exeption on live component when HTMLElement is a Commit
We have a problem with a component where it can't rerender at on error from backend. We would like to catch these errors and serve them with frontend. The new version of the library partially has this feature, but we would like to get its revised version. Currently, when an error occurs, we encounter a situation where the script can't process an HTML entity because it contains a comment. Please take this situation into account when handling errors and return some event from live-component.js that we could catch and serve with our own script.

Definitely a bug - excellent catch! We can certainly fix this to not "trip over" the fact that the first child is a comment.
and return some event from live-component.js that we could catch and serve with our own script.
To be clear: you would like a new event so you could handle Ajax errors yourself? For example, a live:response-error where we pass the html and response to you? It would go right before this line, if I understand you correctly: https://github.com/symfony/ux/blob/47be741969c239bf7d73a7a0644cc8e8ce8adc18/src/LiveComponent/assets/src/live_controller.ts#L477
To be clear: you would like a new event so you could handle Ajax errors yourself?
Yes, we thought about something like that. In our use case we need to handle a 401 Unauthorized response. Dispatching such event you mentioned (with response for sure and maybe html as well) is the most flexible way to handle such things I think. Because it gives a possibility to display some message to user, redirect user to a login page and so on.
What's more I can also imagine not so rare situation when you have to handle 5xx ajax errors.
See #587