Vaadin 14 @PWA annotation seems to have no effect

I’ve added the @PWA annotation to the Root layout of a fresh spring boot app. The app itself works fine but I don’t see Chrome download any PWA resources and the offline page is not working. Is there something I’m missing in terms of setting up a Vaadin PWA? Is there something I can check to see if it’s even being processed?

The PWA annotation is on a layout class like the one below:

@Viewport(RootAppLayout.VIEWPORT)
@PWA(name = "Dashboard", shortName = "DB",
startPath = "home",
backgroundColor = "#227aef", themeColor = "#227aef",
enableInstallPrompt = true
)
@Theme(Material.class)
@CssImport(value = "./styles/material/global-styles.css")
@CssImport(value = "./styles/global/components/app-layout.css", themeFor = "vaadin-app-layout")
@CssImport(value = "./styles/global/components/vaadin-grid.css", themeFor = "vaadin-grid")
@CssImport(value = "./styles/global/global-styles.css")
public class RootAppLayout extends AppLayout {

I think, there could be some issues with the annotaion. I also use it and didnt get any installPrompt. After I changed the port of my application form 8080 to 80 (because I used port forwarding), then it worked. I had no idea why. In the browser, look if some errors where thrown and take a look at the service worker and the manifest.

The first thing to notice is that browsers only enable some of the relevant features for pages loaded over https or from localhost (127.0.0.1 does not count).

You can have a look at the Service Worker section in the Application tab in the Chrome developer tools to check whether the service worker is registered properly. In some cases, especially in a development setup when testing things, an invalid service worker can become “stuck” and cause problems. You can explicitly “unregister” it through the same section in the developer tools.

Leif Åstrand:
The first thing to notice is that browsers only enable some of the relevant features for pages loaded over https or from localhost (127.0.0.1 does not count).

That was exactly it. I was using a hostname defined in the OS hosts file instead of localhost and that was throwing it off. Using localhost worked. Thanks!