You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PiT 24.2: error in console when customizing vaadin-button with @CssImport #17345
The custom element definition for "vaadin-button" was finalized before a style module was registered. Make sure to add component specific style modules before importing the corresponding custom element. - http://localhost:8080/VAADIN/build/generated-flow-imports-6b832631.js
changed the title [-]PiT 24.2: error in console when using vaadin-button[/-][+]PiT 24.2: error in console when customizing vaadin-button with @CssImport[/+]on Aug 2, 2023
Activity
manolo commentedon Aug 2, 2023
Removing this line the error is not shown anymore https://github.com/vaadin/bookstore-example/blob/v24/src/main/java/org/vaadin/example/bookstore/ui/MainLayout.java#L34
[-]PiT 24.2: error in console when using vaadin-button[/-][+]PiT 24.2: error in console when customizing vaadin-button with @CssImport[/+]TatuLund commentedon Aug 2, 2023
See also #17221
mcollovati commentedon Aug 8, 2023
Although using
@CssImportandthemeForis not recommended with Vaadin 24 (https://vaadin.com/docs/latest/styling/legacy/css-import), it should still work.The problem seems to be that because of bundle lazy loading, the CSS from the annotation is loaded too late.
I'm not sure if it is a proper fix, but forcing an eager load for chunks that has CSS loaded with
themeForseems to workknoobie commentedon Aug 8, 2023
Note: Sadly CssImport / themeFor (especially for add-ons) is still a must have because of some limitation documented by Rolf here: vaadin/docs#2552
fix: eager load css from CssImport.themeFor
fix: eager load css from CssImport.themeFor (#17408)
fix: eager load css from CssImport.themeFor (#17408)
fix: eager load css from CssImport.themeFor (#17408) (#17431)
vaadin-bot commentedon Aug 17, 2023
This ticket/PR has been released with Vaadin 24.2.0.alpha7 and is also targeting the upcoming stable 24.2.0 version.
vaadin-bot commentedon Aug 22, 2023
This ticket/PR has been released with Vaadin 24.1.6.