Favicon issue

I’ve migrated an app to Vaadin 25 and now the favicon is no longer generated correctly.

I see the blue with with circle default icon instead of my icon.

Security config is correct and the file is 512x512 and stored in /src/resources/META-INF/resources/icons/icon.png

Any hint why Vaadin doesn’t pick up my icon are appreciated.

It looks like a bug.
During the frontend build, TaskGeneratePWAIcons correctly generates PWA icons based on the project PNG in META-INF/resources/icons/icon.png, but then they are overwritten by TaskPrepareProdBundle with the icons from the default prod bundle.

It is easily reproducible with the skeleton-starter-flow-spring project by just running a production build (mvn package). In dev mode I see the correct icon, but running the app from the production fat JAR, the default one is shown.

The same issue appears to be present also in 24.9.

I guess this does not happen when a custom bundle is required.

@SimonMartinelli would you be so kind as to create an issue on the Flow repository?

Thanks @marcoc_753

Indeed the other app where it works has a custom bundle

1 Like

I guess the easiest fix is to remove the generated PWA icons from the prod bundle, since TaskGeneratePWAIcons will anyway generate them again even if a custom icon is not provided in the project.

Biased: never use the default bundles in a production app :face_with_hand_over_mouth:

Posting also here a workaround: rename the icon and update the PWA annotation accordingly. This way the generated icons will not be overwritten by the default production bundle.

2 Likes