hotwired/stimulus

Stimulus controllers sometimes not connecting in Chrome after Turbo (frames or drive) navigation

helhum opened this issue · 4 comments

helhum commented

Seemingly MutationObservers are sometimes not firing in Chrome 1 2 3 4

This happened to me as well yesterday with Chromium Version 112.0.5615.137.

Restarting Chrome did help for me as well. Nevertheless it might be helpful to further investigate that and maybe file an issue with Chrome.

Hey @helhum, do you have a reproducible setup so we can reproduce the issue you are describing?

@marcoroth unfortunately not really. I realised though, that closing the browser tab and loading the page in a new tab mitigates the issue. Until now, this only happened to me with a Vite development setup, never on a production site.

I had the same issue. Restarting Chrome solved it :-/ I have no idea...

I don't know if it's relevant to this issue, but I ran into something similar.

I put my data-controller directly on the <turbo-frame> tag and it was never reconnecting the controller. Moving it onto a <div> underneath the <turbo-frame> fixed the issue.

Hopefully this helps someone else who got to this issue from random Google searching 😄