Upgraded to Vaadin flow 23.2.1 and receiving error when packaging to production war

Upgraded to flow 23.2.1 yeaterday and started getting build errors below. Tried mvn clean, mvn clean install and nothing seems to fix the problem. Any advice is greatly appreciated.

[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:23.2.1:build-frontend (default) on project mytimepay: Execution default of goal com.vaadin:vaadin-maven-
plugin:23.2.1:build-frontend failed: Vite process exited with non-zero exit code.

Try
mvn vaadin:dance

I will try it

Hi Simon, tried it and still getting build errors. Please see below

[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:23.2.1:build-frontend (default) on project mytimepay: Execution default of goal com.vaadin:vaadin-maven-plugi
n:23.2.1:build-frontend failed: Vite process exited with non-zero exit code.
[ERROR] Stderr: 'Searching themes folder ‘C:\Users\Allen\Downloads\mytimepay\mytimepay\frontend\themes’ for theme ‘mytimepay’
[ERROR] no assets to handle no static assets were copied
[ERROR] Found theme files from ‘C:\Users\Allen\Downloads\mytimepay\mytimepay\frontend\themes’
[ERROR] vite v3.1.0 building for production…
[ERROR] transforming…
[ERROR] ? 136 modules transformed.
[ERROR] [vite]: Rollup failed to resolve import “@vaadin/vaadin-lumo-styles/mixins/loader.js” from “node_modules/@vaadin/combo-box/theme/lumo/vaadin-combo-box-dropdown-sty
les.js”.

Scanned the logs and also found these warnings

[←[1;33mWARNING←[m] Multiple npm versions for @vaadin/vaadin-lumo-styles found: [23.2.0-alpha2, 23.2.1]. First version found ‘23.2.0-alpha2’ will be considered.
[←[1;34mINFO←[m] Visited 3169 classes. Took 4299 ms.
[←[1;34mINFO←[m] Visited 201 classes. Took 139 ms.
[←[1;34mINFO←[m] Unable to determine version information. No vaadin-core-versions.json found

I was able to fix the problem by running mvn vaadin:dance, then updated pom.xml flow 23.2.0. I will attempt to upgrade to 23.2.1 again to see if the problem persist. thanks Simon

The build seems fine now. Thank you Simon!

Never mind, same build errors surfaced again.

Do you use add-ons?

Hi knoobie, yes I have add-ons. Here are the add-ons I am currently using.

tabsheet
twincolgrid
enhanced-dialog
togglebutton
scrolllayout
popup
vaadin-timeu-wizard
year-month-calendar
pdf-browser
file-download-wrapper
lumogridlayout
tooltip
badge

Damn that’s a lot :sweat_smile: looking at your exception, I have a feeling that at least one addon contains flow dependencies it shouldn’t have… with e.g. wrong scope which results in duplicated dependencies

With “mvn dependency:tree” you can print out the whole dependencies and exclude the duplicated entry of vaadin-core, lumo or flow-server from the addon like so:

com.vaadin vaadin-core

LOL, it’s a big app and I’m not one to re-invent the wheel :-). You might be right, I don’t have any build issues with 23.2.0 but when upgrading to 23.2.1 something is off but I wasn’t sure where. Thanks I’ll check the depency tree for duplicates.

[←[1;33mWARNING←[m] Multiple npm versions for @vaadin/vaadin-lumo-styles found:  [23.2.0-alpha2, 23.2.1]. First version found '23.2.0-alpha2' will be considered.

You need to see who is bringing in 23.2.0-alpha2 and fix that

npm ls --all

might give you some hint

It might be fixable also by adding

    "@vaadin/vaadin-lumo-styles": "$@vaadin/vaadin-lumo-styles",

to the overrides section of package.json

Unable to determine version information. No vaadin-core-versions.json found

This looks like the root cause of the problem though. Not sure why you would see that but if it cannot find vaadin-core-versions.json (which is in vaadin-core) then it won’t lock versions for packages like vaadin-lumo-styles to the correct one and you will see these kind of problems

I have a feeling that at least one addon contains flow dependencies it shouldn’t have… with e.g. wrong scope which results in duplicated dependencies

With “mvn dependency:tree” you can print out the whole dependencies and exclude the duplicated entry of vaadin-core, lumo or flow-server from the addon

You cannot have multiple versions of a Maven dependency in a project though, right?

That’s technically true, but mavens resolution makes it possible that earlier declared / transitive dependencies are used… like if an addon is declared before vaadin/vaadin-core it’s possible that the transitive version of flow from the addon is used (damn magic sh*t sometimes)