New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS client crashes when submitting a form that results in switching the underlying LiveView instance #3068
Comments
Have you tried to reproduce this on the latest main? We had several bug fixes wrt to live components and this may already be fixed. Thanks! |
Just did. Unfortunately, the bug is still there. |
If it's of help, tomorrow I can try pinpoint the exact commit when the bug was introduced. |
We'll need a minimal reproduction to be able to look at this one as it involves a lot of moving pieces. Thanks! |
I'll see what I can do. |
Hi there,
Error in browser console:
When happens the client side javascript error?
|
I try will reproduce in a small setup... |
@marschro I think your issue is already solved on main |
Ah, thanks, @SteffenDE - I'll check - thought already I can contribute anything useful ;-) |
@chrismccord I've found where the bug is while reducing the app to the minimum. Haven't finished it yet but since I need to spend more hours to complete it, I need to ask you first if the following description can give you enough clue to pinpoint and fix the bug without the demo app.
That element without id may be a button such as the one below: <button
type="button" phx-click="show_config"
phx-mounted={JS.show( transition: {"delay-500 ease-out duration-150", "opacity-0", "opacity-100"}, time: 650)}
>
My button
</button> All it takes to circumvent the bug is to add an id to the button (or remove the |
Thanks @SteffenDE. Yes it looks like Chris committed a fix for the bug I was having, the same as @marschro. I am wondering if it is possible to get a sense of when 0.20.5 would be tagged. It feels like "when its ready" is the vibe, which is totally fine, I just don't love having to go to production pointing my dependencies to a commit hash in main if I can avoid it. |
Environment
66d38cf704f51231ac69098a220fa4760d0cb0b9
)Actual behavior
Important:
In a LiveView instance, one of its live components opens an option list form (another live component) that submits the user-selected item(s) to the live component that opened it. Once received and interpreted the form data, the live component that opened the form live component navigates to a route that results in switching the current LiveView instance with another one.
On the JS client the last JSON object received prior to JS crashing is the update of the form that submitted the data. Then the following error occurs:
Following the error, the target route page JSON object is received and rendered properly. Given the circumstances (having the LiveView instance switched) the app continues to run normally.
Expected behavior
The JS client should not crash on Chrome (as it does not crash on Firefox) when the underlying LiveView instance is being switched while the update of the (most probably) no-longer existing form is received.
The text was updated successfully, but these errors were encountered: