Skip to content

Hotswap gets stuck after server restart unless you manually reload the page #24188

@Legioth

Description

@Legioth

Description of the bug

Hotswapping doesn't work at all after a server restart until you reload the page.

Furthermore, code changes done after the restart has completed but before reloading the page will not be used after reloading but only after also making one more code change. Changes done while restarting will be used when reloading.

A very crude solution might be to somehow detect the situation and force a page reload after the restart.

Expected behavior

The most important thing is that the latest version would actually be in use after a page reload.

Preferably, hotswap should just keep working automatically also without a page reload.

Minimal reproducible example

@Route
public class MainView extends Span {
    public MainView() {
        setText("Version 1");
    }
}
  1. Open the view in the browser
  2. Change the version number in the span text to 2 to verify that hotswap works
  3. Restart the server and change the number to 3 while the server is still starting up
  4. Wait until the server has started and then change the number to 4
  5. Reload the page, observe that it now shows Version 3 even though you have 4 in the code.
  6. Change the number to 5 and observe that hotswap now works as expected again

If you instead reload the browser already between step 3 and 4, then everything will remain consistent.

Versions

  • Vaadin / Flow version: Vaadin 25.1.3
  • Java version: 21.0.4-jbr
  • OS version: Mac OS 15.7.4
  • Application Server (if applicable): Spring Boot 4.0.5
  • IDE (if applicable): Eclipse 2025-12 (4.38.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions