New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PWA does not find files from the spring static resources directory #4687
Comments
After this one is fixed, we should change the location of these files in Bakery & Project Base for Spring too. |
I'm not sure whether I correctly understand the issue because it seems I can't reproduce it. If this is the only issue then there is nothing to fix except the example projects. The standard directory for Jar is So I will just move icon file (and any other resources) from webapp to this directory for all sample projects and that's it. Please let me know if there is a real issue in Flow which I don't see at the moment related to PWA and Spring (as I understand we don't have any code which reads the specific directories. The code relies on the static web resources availability. So it's just about whether one or another location works as a static resources location. And it doesn't relate to PWA anyhow. ) |
|
You should verify that the icon works also - so that Flow is able to generate the resources based on the icon (there are different sized icons for different devices generated).
Also now realized, that the besided the icons, also the offline page should work from the static file location for Spring https://github.com/vaadin/flow-and-components-documentation/blob/master/documentation/pwa/tutorial-pwa-offline.asciidoc |
I've verified that icons are generated for the icon within path So I close this. |
Still doesn't work. I use Spring and packaging jar. My icon is in resources/META-INF/resources/icons/icon.png Locally everything works. The icon gets fetched and converted into 144x144 etc. But when i deploy it to the server, vaadin overwrites it with the default icon without an error message. |
@cedricaebi I can confirm. It does work locally but not when running as jar. Regardless if this issue is related to flow, vaadin-spring or any other project it should be fixed. Most people I guess use Vaadin in conjunction with Spring Boot these days. I've found a very dirty classpath hack to workaround the issue 🙄 |
The ticket is apparently about running the app via jar even though the original description doesn't say that:
We have another ticket for that with a proper description which is fixed. |
Based on vaadin/bakery-app-starter-flow-spring#664 (review)
Take https://github.com/vaadin/skeleton-starter-flow-spring
Note that the icon file is located in the
src/main/webapp/icons
directory.Also note that if you launch the app, the icon is available as a static resource at http://localhost:8080/icons/icon.png
Move the icon to
src/main/resources/static/icons
directory, restart an app.Expected: the icon is still shown and loaded
Actual: the default icon is loaded (and the icon is still available at http://localhost:8080/icons/icon.png)
It seems like PWA resources loader should support the resources placed in the standard Spring directories.
The text was updated successfully, but these errors were encountered: