Vaadin 24 Bug

Hey, after i press F9 to rebuild i get the error that no views are existing.
Im using the 24.3.10

Where do you press F9 and are there any errors in the logs?
We need more information to help you

Well, there a not really error in the console.
But we get this on the site: Reason: Error creating bean with name ‘net.fedustria.translate.views.MainLayout’: Failed to instantiate [net.fedustria.translate.views.MainLayout]: Constructor threw exception

That happens mostly after pressing CTRL + F9 to rebuild the project. Sometimes its working, sometimes not. like a 50/50 Chance

Then there is something in the constructor that causes the exception. Maybe a null pointer.
How does the constructor look like?

Well, there is not really much in the constructor. So here is the whole class

public class MainLayout extends AppLayout {

    private H2 viewTitle;

    public MainLayout() {

    private void addHeaderContent() {
        DrawerToggle toggle = new DrawerToggle();
        toggle.setAriaLabel("Menu toggle");

        viewTitle = new H2();
        viewTitle.addClassNames(LumoUtility.FontSize.LARGE, LumoUtility.Margin.NONE);

        addToNavbar(true, toggle, viewTitle);

    private void addDrawerContent() {
        H1 appName = new H1("FedustriaTranslate");
        appName.addClassNames(LumoUtility.FontSize.LARGE, LumoUtility.Margin.NONE);
        Header header = new Header(appName);

        Scroller scroller = new Scroller(createNavigation());

        addToDrawer(header, scroller, createFooter());

    private SideNav createNavigation() {
        SideNav nav = new SideNav();

        for (ENavbarItems item : ENavbarItems.values()) {

        return nav;

    private Footer createFooter() {
        Footer layout = new Footer();

        return layout;

    protected void afterNavigation() {

    private String getCurrentPageTitle() {
        PageTitle title = getContent().getClass().getAnnotation(PageTitle.class);
        return title == null ? "" : title.value();

What does this code do? Especially the create method?

The code creates the items for the navbar. I added the navbar later, so the problem is not from there.

Anyways thats the create method:

I would try to set a breakpoint in the constructor and try to find our what the exception is