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");
}
}
- Open the view in the browser
- Change the version number in the span text to 2 to verify that hotswap works
- Restart the server and change the number to 3 while the server is still starting up
- Wait until the server has started and then change the number to 4
- Reload the page, observe that it now shows
Version 3 even though you have 4 in the code.
- 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)
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
Version 3even though you have 4 in the code.If you instead reload the browser already between step 3 and 4, then everything will remain consistent.
Versions