Tabsheet lost on browser refresh

I am using vaadin 24.6.0 through java spring boot. To add a tabsheet I have created the below code. The tabs do show up correctly on the first view but on browser refresh the tabs are lost. I just see the contents of the first tab while the second tab text is only shown. It cannot be clicked for viewing.

please find the screenshots attached. Kindly suggest what could be going wrong. Thanks.

Initial view
image
On browser refresh
image

Java code

public class ClusterView extends Div {

    public ClusterView() {

        TabSheet tabSheet = new TabSheet();
        tabSheet.add("Elasticsearch Cluster Status", createElasticsearchClusterStatus());
        tabSheet.add("Zeebe Cluster Status", createZeebeClusterStatus());
        add(tabSheet);
    }
    //..other methods
}

try

public class ClusterView extends Div {

    TabSheet tabSheet = new TabSheet();

    public ClusterView() {    
        tabSheet.add("Elasticsearch Cluster Status", createElasticsearchClusterStatus());
        tabSheet.add("Zeebe Cluster Status", createZeebeClusterStatus());
        add(tabSheet);
    }
    //..other methods
}

Good suggestion. I too thought it would work but surprising it didn’t help. I did restart my application to verify multiple times but same outcome.

Does the problem appear in development mode? if yes: It’s a bug and should be reported on GitHub.

No I am running my application with vaadin.productionMode=true so its running in production mode

Note: This does not guarantee it - just in case saying.

If it only happens in production mode, it might be a problem with bundling.

            <configuration>
              <optimizeBundle>false</optimizeBundle>
              <forceProductionBuild>true</forceProductionBuild>
            </configuration>

added to your vaadin-maven-plugin should fix it. But it’s more like a workaround and a proper reproduceable project would help the Vaadin Team to identify the edge case and fix it properly.

1 Like

Surprisingly this has resolved the issue. I will continue testing for sometime.

Thanks for the quick help

and Did you try…

mvn clean package -Pproduction ?

That flag I always had in my mvn command but i didn’t execute it earlier since it I was doing all this locally from Intellij.
mvn -B clean vaadin:build-frontend -Pproduction