Could not navigate to 'localPrivateHome'

V14 compatabilty mode.

The browser address bar has from previous session (for example)http://localhost:8181/localPrivateHome

When the @Route(“”) route starts up from a reload the browser reports

Could not navigate to 'localPrivateHome'

Reason: Couldn't find route for 'localPrivateHome'

Available routes:

    <root>

This detailed message is only shown when running in development mode.

Where can I catch this error or how best to handle this problem.

Something like this:

public class NotFound extends Div implements HasErrorParameter<NotFoundException> {
    @Override
    public int setErrorParameter(BeforeEnterEvent beforeEnterEvent, ErrorParameter<NotFoundException> errorParameter) {
        beforeEnterEvent.forwardTo(MainView.class); // or .forwardTo("") or whatever
        return 404;
    }
}

Thanks, Olli,

Works perfect.