Jmix 2.1: Component class not included in production bundle

First run of version 2.1 with a production build and I am getting some errors in the log. I don’t notice any resulting problems yet, but thought I would ask.

The optimizeBundle = false is present in my build.gradle file.

Nov 11 23:02:33 ip-172-31-33-206 web[12256]: 2023-11-11T23:02:33.053Z ERROR 12256 --- [nio-8080-exec-5] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.loginform.JmixLoginForm includes './src/login-form/jmix-login-form.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(JmixLoginForm.class) where it is used.
Nov 11 23:04:39 ip-172-31-33-206 web[12256]: 2023-11-11T23:04:39.662Z ERROR 12256 --- [nio-8080-exec-5] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.kit.component.valuepicker.ValuePickerButton includes './src/value-picker-button/jmix-value-picker-button.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(ValuePickerButton.class) where it is used.
Nov 11 23:04:39 ip-172-31-33-206 web[12256]: 2023-11-11T23:04:39.665Z ERROR 12256 --- [nio-8080-exec-5] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.combobox.EntityComboBox includes './src/combo-box-picker/jmix-combo-box-picker.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(EntityComboBox.class) where it is used.
Nov 11 23:04:39 ip-172-31-33-206 web[12256]: 2023-11-11T23:04:39.666Z ERROR 12256 --- [nio-8080-exec-5] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.tabsheet.JmixTabSheet includes './src/tabsheet/jmix-tabsheet.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(JmixTabSheet.class) where it is used.
Nov 11 23:05:28 ip-172-31-33-206 web[12256]: 2023-11-11T23:05:28.681Z ERROR 12256 --- [nio-8080-exec-6] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.valuepicker.EntityPicker includes './src/value-picker/jmix-value-picker.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(EntityPicker.class) where it is used.

Hi!

I tried to reproduce the problem with runtime configuration and with JAR. The production build started correctly.
Can you provide a project with a minimal reproduction enviroment?

Regards,
Dmitriy

Try with this in your build.gradle

vaadin {
optimizeBundle = false
productionMode = true
}

1 Like

I’ll have to do some more testing to see if I can narrow it down more. If it matters, this is a production build deployed to AWS Beanstalk.

I do have -Pvaadin.productionMode=true as part of the command line for the gradle bootJar task.

Here is a wider portion of the log to maybe give context about where the component errors appear. The first one about the JmixLoginForm happens when I load the standard login view. The others happen when I load other views in my application.

Nov 13 01:27:53 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:53.852Z  INFO 90201 --- [           main] c.v.f.s.DefaultDeploymentConfiguration   : Vaadin is running in production mode.
Nov 13 01:27:53 ip-172-31-33-206 web[90201]: The following feature previews are enabled:
Nov 13 01:27:53 ip-172-31-33-206 web[90201]: - SideNav component (Production ready but tweaks to at least the internal DOM will still take place)
Nov 13 01:27:53 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:53.980Z  INFO 90201 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
Nov 13 01:27:53 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:53.985Z  INFO 90201 --- [           main] o.s.s.quartz.SchedulerFactoryBean        : Starting Quartz Scheduler now
Nov 13 01:27:53 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:53.998Z  INFO 90201 --- [           main] o.s.s.quartz.LocalDataSourceJobStore     : Freed 0 triggers from 'acquired' / 'blocked' state.
Nov 13 01:27:54 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:54.008Z  INFO 90201 --- [           main] o.s.s.quartz.LocalDataSourceJobStore     : Recovering 0 jobs that were in-progress at the time of the last shut-down.
Nov 13 01:27:54 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:54.008Z  INFO 90201 --- [           main] o.s.s.quartz.LocalDataSourceJobStore     : Recovery complete.
Nov 13 01:27:54 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:54.010Z  INFO 90201 --- [           main] o.s.s.quartz.LocalDataSourceJobStore     : Removed 0 'complete' triggers.
Nov 13 01:27:54 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:54.011Z  INFO 90201 --- [           main] o.s.s.quartz.LocalDataSourceJobStore     : Removed 0 stale fired job entries.
Nov 13 01:27:54 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:54.016Z  INFO 90201 --- [           main] org.quartz.core.QuartzScheduler          : Scheduler quartzScheduler_$_NON_CLUSTERED started.
Nov 13 01:27:54 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:54.163Z  INFO 90201 --- [           main] o.ajjf.membership.MembershipApplication  : Started MembershipApplication in 21.909 seconds (process running for 23.3)
Nov 13 01:27:54 ip-172-31-33-206 web[90201]: 2023-11-13T01:27:54.164Z  INFO 90201 --- [           main] o.ajjf.membership.MembershipApplication  : Application started at http://localhost:8080
Nov 13 01:29:11 ip-172-31-33-206 web[90201]: 2023-11-13T01:29:11.349Z  INFO 90201 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
Nov 13 01:29:11 ip-172-31-33-206 web[90201]: 2023-11-13T01:29:11.351Z  INFO 90201 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
Nov 13 01:29:11 ip-172-31-33-206 web[90201]: 2023-11-13T01:29:11.355Z  INFO 90201 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 3 ms
Nov 13 01:30:24 ip-172-31-33-206 web[90201]: 2023-11-13T01:30:24.956Z ERROR 90201 --- [nio-8080-exec-2] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.loginform.JmixLoginForm includes './src/login-form/jmix-login-form.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(JmixLoginForm.class) where it is used.
Nov 13 01:30:29 ip-172-31-33-206 web[90201]: 2023-11-13T01:30:29.949Z  INFO 90201 --- [nio-8080-exec-8] i.j.core.impl.FetchPlanRepositoryImpl    : Initializing fetch plans
Nov 13 01:32:07 ip-172-31-33-206 web[90201]: 2023-11-13T01:32:07.924Z  INFO 90201 --- [nio-8080-exec-3] j.c.p.i.AnnotationLockDescriptorProvider : Collecting pessimistic locks configuration annotations
Nov 13 01:32:08 ip-172-31-33-206 web[90201]: 2023-11-13T01:32:08.012Z ERROR 90201 --- [nio-8080-exec-3] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.kit.component.valuepicker.ValuePickerButton includes './src/value-picker-button/jmix-value-picker-button.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(ValuePickerButton.class) where it is used.
Nov 13 01:32:08 ip-172-31-33-206 web[90201]: 2023-11-13T01:32:08.013Z ERROR 90201 --- [nio-8080-exec-3] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.combobox.EntityComboBox includes './src/combo-box-picker/jmix-combo-box-picker.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(EntityComboBox.class) where it is used.
Nov 13 01:32:08 ip-172-31-33-206 web[90201]: 2023-11-13T01:32:08.013Z ERROR 90201 --- [nio-8080-exec-3] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.tabsheet.JmixTabSheet includes './src/tabsheet/jmix-tabsheet.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(JmixTabSheet.class) where it is used.

I have a similar error messages

2023-12-01T18:29:32.251+06:00 ERROR 1 --- [nio-8080-exec-2] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.codeeditor.CodeEditor includes './src/code-editor/jmix-code-editor.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(CodeEditor.class) where it is used.
2023-12-01T18:29:32.252+06:00 ERROR 1 --- [nio-8080-exec-2] c.v.flow.component.internal.UIInternals  : The component class io.jmix.flowui.component.tabsheet.JmixTabSheet includes './src/tabsheet/jmix-tabsheet.js' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(JmixTabSheet.class) where it is used.

I builded with command

./gradlew -Pvaadin.productionMode=true bootJar

and my build.gradle has

vaadin {
    optimizeBundle = false
}

Jmix version 2.1.1

Have you set the vaadin.whitelisted-packages property?
If so, remove it.

I do not have that property set on my application.

I don’t have vaadin.whitelisted-packages.

Today I tried adding -Pvaadin.forceProductionBuild=true to the gredlew command, hoping that there was some part of the production bundle that was out of date or that the dev-bundle was somehow being used, but unfortunately there was no difference. The errors about the component class missing from production bundle still occur.

I don’t know anything about vaadin, but thought the stats.json file (attached) might be of use for troubleshooting. This was taken from the resulting bootJar produced during my latest build. It was in the META-INF/VAADIN/config/ folder within the bootable JAR.

stats.json (14.2 KB)

Same problems here on Jmix 2.1.1

Hi everyone, the team is aware of the problem and investigating it.

3 Likes

Hi everyone,

After investigation, it appears to be a Vaadin bug. I’ve create a GitHub issue. If no fix from them will be provided, we will fix it ourself using WA. Because components work, you can ignore ERROR message.

Regards,
Gleb

2 Likes

That is great news - thanks for tracking it down. It looks like the vaadin team has already started on a fix.

Confirmed I no longer get these warnings in the log after the upgrade to jmix 2.1.2

1 Like

Hi,
I have the same problem with version 2.1.3

Hi!

Please, see related topic: Still missing js include in production front end in Jmix 2.1.3

Regards,
Dmitriy

This answer solved a big problem I had. Thank you!
The problem was: fileStorageUploadField did not work when in production mode.