Skip to content

Missing styles when offline #5806

Closed
vaadin/flow
#25047

Description

@Lars-jnk

Describe the bug

no styles when running offline

Expected-behavior

have styles when running offline

Reproduction

go offline and start

System Info

Linux
hilla: 25.2.1

Activity

  1. added
    bugSomething isn't working
    hillaIssues related to Hilla
    on Jul 11, 2026
  2. moved this to 🔖 Normal Priority (P2) in Vaadin Flow bugs & maintenanceon Jul 14, 2026
  3. platosha commented on Jul 16, 2026

    @platosha
    Contributor

    Can reproduce with a basic offline application. The reason is that @StyleSheet are not added to offline cache list. While the fix is in progress, the workaround is to list stylesheets in offlineResources:

    @StyleSheet(Aura.STYLESHEET)
    @StyleSheet("styles.css") // Your custom styles
    @PWA(name = "Offline Application", shortName = "Offline App", offlineResources = {
            "styles.css",
            "aura/aura.css"
    })
  4. Lars-jnk commented on Jul 16, 2026

    @Lars-jnk
    Author

    With Lumo would it be like that? But it still the same.

    @SpringBootApplication
    @PWA(name = "name", shortName = "name", offlineResources = {"styles.css", "lumo/lumo.css"})
    @StyleSheet(Lumo.STYLESHEET)
    @StyleSheet(Lumo.UTILITY_STYLESHEET)
    @StyleSheet("styles.css")
    
  5. platosha commented on Jul 17, 2026

    @platosha
    Contributor

    @Lars-jnk yes, for Lumo should be like that, also including ulility stylesheet:

    @PWA(name = "name", shortName = "name", offlineResources = {"styles.css", "lumo/lumo.css", "lumo/utility.css"})

    You could confirm the path names by checking the request paths for missing stylesheets in the network inspector in browser dev tools. There is a request type filter, setting CSS-only should help to reveal those. With Chrome dev tools, please take a look there:

    Image
  6. Lars-jnk commented on Jul 17, 2026

    @Lars-jnk
    Author

    Right, I should have thought about that. I'm no "born" front end dev... :)
    But I don't see any styles there when offline.
    When I access "http://localhost:8081/lumo/lumo.css" I see them offline, same for "styles.css".
    Should I import the files somewhere I my TS files?
    I also started my project years ago but I followed the changes - as least I Hope I didn't missed any.
    Atm are the styles in "resources/META-INF.resources"

  7. platosha commented on Jul 20, 2026

    @platosha
    Contributor

    Importing styles from TS files might help, yes, worth a try. At the same time, it might introduce a duplicate import if you are also using @StyleSheet.

    If working correctly, @StyleSheet entries should end up as <link> tags in the head section in HTML, both online and offline. That is what should make the styles apply. Please check if you have those in HTML response.

    Also, please consider sharing an isolated repro if possible. It's fairly difficult to tell where the issue is otherwise.

  8. moved this from 🟢Ready to Go to ⚒️ In progress in Vaadin Flow | Hilla | Kits ongoing workon Jul 23, 2026
  9. added a commit that references this issue on Jul 24, 2026
    ebb298a
  10. moved this from 🔖 Normal Priority (P2) to ✅ Closed in Vaadin Flow bugs & maintenanceon Sep 9, 2026
  11. added a commit that references this issue on Sep 9, 2026
    2a0ca9d
  12. added 2 commits that reference this issue on Sep 9, 2026
    9952842
    2c920d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions