aurelia / aurelia

Aurelia 2, a standards-based, front-end framework designed for high-performing, ambitious applications.
MIT License
1.4k stars 147 forks source link

Routes get rendered multiple times - Hot Reload - @aurelia/vite-plugin #2062

Open ivanbacher opened 2 months ago

ivanbacher commented 2 months ago

🐛 Bug Report

my-app.html

<import from="./my-element.html"></import>

<div class="message">${message}</div>

<my-element></my-element>

<div>
  <au-viewport></au-viewport>
</div>
Screenshot 2024-10-04 at 10 40 54

When a change happens in the new route that was created: then route is added again.

Screenshot 2024-10-04 at 10 42 01

Page needs to be reloaded to get everything back to normal. I am assuming it could have something todo with how Vite handles reloads?

Repo: test-app.zip

bigopon commented 2 months ago

Yes at a glance it seems this is hot reload, since the unmounting behavior isnt smart, and because of host controller involved. Thanks @ivanbacher