vaadin / flow

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

Duplicate <root> in 404 view when mixing `@Route("")` with `@layout.tsx` #20262

Open Legioth opened 1 week ago

Legioth commented 1 week ago

Description of the bug

In an application with a Flow view as for the root route and a client-side main layout, the dev mode 404 view contains two <root> entires. This is a regression between 24.4 and 24.5

Expected behavior

Expected to only have a single <root> entry in the 404 view.

Minimal reproducible example

  1. Create a project at https://start.vaadin.com/ with a single Flow view. Make sure Vaadin 24.5 is used as the platform version and React (Hilla) is used for the main layout.
  2. Launch using mvn
  3. Navigate to http://localhost:8080/foo or any other non-existing route

Versions

caalador commented 1 week ago

Seems like the RouteNotFoundError just collects server routes and then client routes without any checking of what there is. Also the client routes are not filtering away layouts which leads to having the 2 "" root targets.

The gotten client routes should filter Layout targets away from the results.