Components missing when loading view via reflection

I’m building a generic app library for a couple of my apps that dynamically build their ui and load views via reflection. It appears that not all components like this approach. I know this was a problem in earlier Vaadin versions (~14) but it appears that it is not fully resolved.

The components causing problems are: TextArea, RadioButton, Tabs, Menus.

Basically the component is present in the dom, and can been seen by the browser inspector, but fails to layout/display correctly.
If I construct an instance directly, not via reflection, then all works well.

Is there a way to get Vaadin to build the correct frontend files for this?

Running Vaadin 17.0.1, SpringBoot 2.3.3, Java 13, Linux.


The frontend build tries to remove all the unused components, for example if the Tabs (Java component) is not used then the vaadin-tabs web component is not in your bundle. It’s working great if you’re using the component directly but it’s not working if you are using reflection.

One solution is to tell your class that it’s using TextArea …

You can annotate the class with

Are you using this annotation already? Is your code is running in Vaadin 14 but not Vaadin 17 ?