vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
604 stars 166 forks source link

Fails to open or reload browser tab on the second launch #19969

Open jojule opened 1 day ago

jojule commented 1 day ago

Description of the bug

When I launch my new project with mvn it opens up http://localhost:8080/ as expected on Chrome.

When I kill the server (mvn) and run it again, it does not launch the browser.

Way to fix the issue is to delete target/tab.launch. After that mvn agains opens the browser as expected. And recreated the file. Leading back to the original problem.

Expected behavior

mvn command should always open my application in a browser.

Minimal reproducible example

Minimal Hello World application from start.vaadin.com with two views: One for Hilla and for Flow

Versions

Hilla: 24.5.0.alpha15 Flow: 24.5.0.alpha20 Vaadin: 24.5.0.alpha17 Copilot: 24.5.0.alpha20 Frontend Hotswap: Enabled, using Vite OS: aarch64 Mac OS X 15.0 Java: JetBrains s.r.o. 21.0.3 Browser: Chrome 128.0.6613.138 (Official Build) (arm64) Java Hotswap: false IDE Plugin: 1.3.1 IDE: IntelliJ 2024.2

caalador commented 1 day ago

Yes this is by design #18393 The bigger issue was that developers restart their server, but leave the browser page open leading to an increasing amount of tabs. But as there is no way to know if there is a tab open in some browser there is instead a timeout (30 min) after latest open tab call. To always open a tab just run mvn with the clean target and server start (e.g. spring-boot:run)

mcollovati commented 1 day ago

Another way to always open the browser is to set vaadin.launch-browser-delay=0 in application.properties