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
@CssImport of the add-on gets ignored in production mode on the first load #17221
I have an add-on that has some styles of its own, say, e.g. TwinColSelect
@Tag("twin-col-select")
@CssImport(value = "./twincolselect.css")
@CssImport(value = "./twincolselect-checkbox.css", themeFor = "vaadin-checkbox")
public class TwinColSelect<T> extends AbstractField<TwinColSelect<T>, Set<T>>
...
}
This worked ok in Vaadin 24.0, but styles fails to load in Vaadin 24.1.3 in production mode when using the add-on in actual app. However in Vaadin 24.1.3 styles are loaded ok in development mode.
Production mode looks like this
Expected behavior
The development mode works, I would expect to see the same in production mode
changed the title [-]@CssImport of the add-on gets ignored in production mode[/-][+]@CssImport of the add-on gets ignored in production mode on the first load[/+]on Jul 14, 2023
@TatuLund I did a quick test adding TwinColSelect add-on to the flow spring starter application.
I built for production and the styles seem to be correct, and I cannot see the error on the console.
Could you provide an example project that reproduces the issue? Maybe it happens when mixing different add-ons or with a some custom theme settings?
Activity
TatuLund commentedon Jul 14, 2023
Furher info, I can see the following warning in the console log in production mode
Also, if I reload the page, the styles are being loaded. I.e. the bug happens only at the first load of the view.
[-]@CssImport of the add-on gets ignored in production mode[/-][+]@CssImport of the add-on gets ignored in production mode on the first load[/+]knoobie commentedon Jul 14, 2023
I'm wondering.. does this also effect 24.1.1? Or could this be related to https://github.com/vaadin/flow/pull/17129/files?
mcollovati commentedon Jul 18, 2023
@TatuLund I did a quick test adding TwinColSelect add-on to the flow spring starter application.
I built for production and the styles seem to be correct, and I cannot see the error on the console.
Could you provide an example project that reproduces the issue? Maybe it happens when mixing different add-ons or with a some custom theme settings?
knoobie commentedon Jul 18, 2023
I have seen the same error in the production client log with the following setup:
formcollovati commentedon Jul 18, 2023
Tried also that way, but I'm still not able to reproduce
mcollovati commentedon Jul 18, 2023
Ok, I can reproduce the issue if I load a page with a CheckBox component and then navigate to the route with the TwinColSelect add-on
mcollovati commentedon Jul 18, 2023
Same issue also with Vaadin 24.1.1 and 24.1.0
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.