Closed ekrist1 closed 2 years ago
Found the explanation here: https://discuss.hotwired.dev/t/controller-initialized-twice-when-visiting-from-a-turbolinks-page/17
Had a 3rd party library which seemed to had some troubles with the caching, so disabling it with data-turbo-cache="false" works.
I don't know if this is a Turbo or Hotwire issue, or if it somehow is linked to the Laravel Hotwire implementation.
It seems like the Stimulus controllers are loaded twice during the second visit. I have a clean install with the hello_controller. On the first visit, everything is fine. If I visit the same page twice, the hello_controller is initialised twice.