Grid partNameGenerator does not work in production mode

I am experiencing rather strange problem … The code below (that set partNameGenerator at grid column) works fine in the development mode but does not work in production mode. Styles are available but just not added to the corresponding columns. Again, everything works just fine in development mode …

    `grid.addColumn("status")       .setHeader("Status").setAutoWidth(false).setSortable(false)
        .setPartNameGenerator(r ->
                switch (r.getStatus()) {
                    case ERROR -> "error";
                    case WARNING -> "warning";
                    default -> "success";
                }
            );`

partNameGenerator also does not work being set at grid level … I would appreciate any help. Vaadin version in 24.1.12

partNameGenerator does not work in production mode

Grid partNameGenerator does not work in production mode

Well, it looks like Vaadin just can not find my theme … I am using Vaadin gradle plugin and Spring boot jar. The theme was packaged here in boot jar: \META-INF\VAADIN\webapp\VAADIN\static\themes\my-theme
In the configuration it is referenced just as @Theme(value = “my-theme”). Could you please advice what’s wrong with that?

The theme should be in frontend/themes/mytheme according t the documentation

It is there and is accessible by dev server

Or in src/main/resources/META-INF/resources/themes/my-theme if packaged in a JAR

I did a quick test and it works fine for me.
Are you able to reproduce the issue in a simple project and share it?

Is it working with spring boot jar? Could you please share your spring boot jar with me?

That’s probably the thing I don’t understand:

The theme was packaged here in boot jar: \META-INF\VAADIN\webapp\VAADIN\static\themes\my-theme
To me the path is wrong, can you share your project structure?

Yes, spring boot jar packaged with spring-maven-plugin

This is the package structure, though I am usgin Gradle to build the project …
image.png

Anyway, in a production build the theme CSS should be packaged into a bundled created file

Where are the CSS rules defined? In the styles.css file?

I tried to package the theme in some other jar, in the recommended path (resources/META-INF/resources) but this does not help … Though theme was not packaged in \META-INF\VAADIN\webapp\VAADIN\static this time. Yes, rules are defined in styles.css.

Could you please share your test boot jar just in order to understand what is the right place for the theme files?

The theme CSS files are not present in the final JAR. The styles are in the generated files (look for vaadin-grid::part(mycustompart) below)

META-INF/VAADIN/webapp/VAADIN/build/indexhtml-33720db2.js: */D("utility",lt);const sn=`vaadin-scroller[slot=drawer]{padding:var(--lumo-space-s)}[slot=drawer]:is(header,footer){display:flex;align-items:center;gap:var(--lumo-space-s);padding:var(--lumo-space-s) var(--lumo-space-m);min-height:var(--lumo-size-xl);box-sizing:border-box}[slot=drawer]:is(header,footer):is(:empty){display:none}vaadin-grid::part(mycustompart){font-weight:700;color:#00f}
META-INF/VAADIN/webapp/VAADIN/build/index-e703f2c2.css:vaadin-scroller[slot=drawer]{padding:var(--lumo-space-s)}[slot=drawer]:is(header,footer){display:flex;align-items:center;gap:var(--lumo-space-s);padding:var(--lumo-space-s) var(--lumo-space-m);min-height:var(--lumo-size-xl);box-sizing:border-box}[slot=drawer]:is(header,footer):is(:empty){display:none}vaadin-grid::part(mycustompart){font-weight:700;color:#00f}

Hm, I do not see that in my generated files … May be Gradle plugin is somehow broken?

Can you share the logs of the production build?

Should I enable debug?