Has anyone run into problems when using Stimulus inside a lazy loaded iframe in Chrome? We’re specifically seeing issues when a tab is opened in the background, and only occasionally. Inside the iframe’s Javascript context, Stimulus
is defined, but there are no objects in Stimulus.controllers
.
The closest other bug I can find is Turbo lazy loading not connecting stimulus controller · Issue #47 · hotwired/turbo · GitHub, but we’re on Stimulus 3. Because of the inconsistent nature of this problem, I’m suspicious of Chrome’s Tab Throttling feature, but I can’t say I understand exactly what it’s doing (and Stimulus seems to be using Google’s stated best practices eg use of MutationObserver).
So far we haven’t seen this in any other browser.