Closed enver-haase closed 2 years ago
https://stackoverflow.com/questions/70248918/is-vaadins-cssimport-annotation-broken
may be related -- in which case downgrading to 14.5.5 could be an option.
Could you please attach an example project which reproduces the issue? I know it's hard (given the set of stack used), but believe me - it's even harder for me :)
When debugging this yesterday, @mstahv and me found that the customer project, while attributing @CssImport to one component, never actually add the component with that attribute to the component tree. Please can you, therefore, close the bug as INVALID.
Thank you for letting me know, good to know :+1:
Desktop (please complete the following information):
Describe the bug A clear and concise description of what the bug is.
I have a customer project that shows the following behaviour:
Add a tile, its styling is not loaded. Add another type of tile, both tiles' styling are loaded and applied. Meaning: the first component's @CssImport is ignored only in production mode.
You can see this in the Chrome tools Network tab: the style of the first tile is included in the bundle that is only loaded when the second tile is added to the view.
To Reproduce Steps to reproduce the behavior:
Setup project 'web-components-skill'. I cannot share this project publicly, but I am happy to work on it together with the assignee.
Run Gradle task 'gradle -x javadoc build'.
Deploy artifact build/libs/web-components-skill-1.0-SNAPSHOT.war to apache-tomee-webprofile-8.0.8/webapps
Start TomEE if not done so already
Open localhost:8080/web-components-skill-1.0-SNAPSHOT.war
Add a tile of the lowermost kind, size 1 -- see the styling problem
Add a tile of the middle kind, size 1 -- see how the problem goes away.
Expected behavior When loading the second/third/fourth CSS/JS bundle, this should happen already with a first loaded tile of the lowermost kind; the @CssImport it has is proven to be correct (e.g. works in development mode). Also, when we add a fake @Route("foo") to the component (SkillKennzahl.java) then the component scanner adds it to the initially loaded bundle and the behaviour is correct.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context When I add
to the build.gradle file, then all the styles are in the bundle loaded initially -- which gives a somewhat slower startup time but correct behaviour.
Please get in touch with me. It is highly possible that this bug is lurking in the Maven plugin's bytecode scanner too. --Enver