-
Notifications
You must be signed in to change notification settings - Fork 168
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
Missing native-image hints for PWA icon #19123
Comments
Looking at Quarkus that points to oracle/graal#4921. Link to the Quarkus commit quarkusio/quarkus@a354621 |
In my case it was a Spring Boot application. I'm fine with maintaining the hints locally, but maybe they should be added to the framework. |
I mentioned the Quarkus class only because the hints in Flow were updated based on it |
I was able to reproduce
Collect Metadata with the Tracing Agent
(Browser requests icons/icon-180x180.png when playing a sound) Required hintsThe required hints (in
After adding these hints, I was able to play the sound in the native image, with no exceptions being logged when the icon is requested. Note that one of the hints is about So far, I've not been able to reproduce VersionsVaadin / Flow version: 24.3.7 |
This should have been fixed in recent Vaadin version. |
Can't reproduce with 24.5 |
I can't provide a complete proof that it has been tested due to encountering this issue: oracle/graal#4124, I have similar exceptions and I'm using macOS:
also:
Tested with I'd propose to close this ticket, likely it's a GraalVM issue that prevents to use PWA in Vaadin with native-image. |
I'm getting the couldn't initialize class on Windows 11 also with GraalVM 23.0.1+11.1, Vaadin 24.5.5 (also 24.5-SNAPSHOT)
This comes when the app is running and service worker requests |
#20516 to be tested if it helps to fix this issue with PWA icon. |
Tested against 24.6-SNAPSHOT and there the exception is not thrown anymore when the images are pregenerated. |
According to Quarkus code, it seems AWT integration is not yet working in native-image for Windows @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
UnsupportedOSBuildItem osSupportCheck() {
return new UnsupportedOSBuildItem(WINDOWS,
"Windows AWT integration is not ready in native-image and would result in " +
"java.lang.UnsatisfiedLinkError: no awt in java.library.path.");
} |
Could we just try to fix this "properly"? To me the AWT usage at runtime sounds like a design bug we should fix. It makes some raster images scaling? Shouldn't that be done when doing a production build of the client bundle? |
#20516 generates PWA icons at build time |
Ah, excellent, so only trying to get it work in older branches? |
#20516 is not binary compatible, thus I'd not doing backport in a patch release, but rather in the future minor releases of V14 and V23. |
Closed based on #19123 (comment) testing. |
Description of the bug
Running a Vaadin 24.3.7 application with
@PWA
and a custom icon (located at src/main/resources/META-INF/resources/icons/icon.png), compiled into a native image using GraalVM 21 results in the following errors. Interestingly, the Tracing Agent did not provide the anticipated hints during initial testing.#16307 also mentions the following hint, which in my case was produced by the Tracing Agent:
Expected behavior
In 2022 @mstahv said that "Vaadin don’t yet come with these hints", but now there is VaadinHintsRegistrar and the documentation does not mention a word about hints, so I'm inclined to think that I could expect it to work.
Icon generation in native apps seems to be a known issue, though #16307 (comment).
Minimal reproducible example
A Vaadin 24.3.7 application with
@PWA
and a custom icon.Versions
The text was updated successfully, but these errors were encountered: