How to fix 'Unexpected Application Error! 404 Hey developer...' error?

I get this error page when i insert multiple ‘/’ into URL and/or try to navigate depending on how many ‘/’ are included.

For example when i create a valid url for my vaadin application and insert two (‘//’), the url is resolved, content showed, but then when i try to navigate using UI controls, this error shows up.

Another example might be when i insert multiple (‘/////’) inside url, the error page shows up immediately.

No error logs, just this page, which seems unrelated to flow or spring…

I am using latest flow 24.8.5 and spring 3.5.4 and tomcat container.

I have implemented custom ErrorHandler, but it is not catching this error

@Component
public class VaadinErrorHandler implements ErrorHandler {

    @Override
    public void error(final ErrorEvent event) {
        EbozLogger.w(MessageFormat.format("Uncaught vaadin exception on component [{0}]: {1}",
                event.getComponent().isPresent() ? event.getComponent().get().getClass().getSimpleName() : "",
                ExceptionUtils.getStackTrace(event.getThrowable())));
        val ui = UI.getCurrent();
        if (ui != null) {
            ui.access(() -> {
                showErrorDialog(event.getThrowable(), ui);
                ui.push();
            });
        }
    }

It looks like to me this error page comes from Hilla and the client-side React Router.

You can take a look here if you want ot customize the page: How to implement routing in Hilla React apps | Vaadin

Or you can ask in the Hilla category or search for/create a ticket on the Hilla GitHub repository.