Search code examples
angularprogressive-web-appsangular-service-worker

Unable to see Install button on PWA developed on Angular using service workers after publish


I have angular version 12.2. I am using Service Worker. When I run on localhost it works fine and displays install button on browser. But when I deploy it to my server or IIS server, install button doesn't show. Here is the picture of localhost enter image description here

I have followed all the steps mentioned on Angular website Getting started with service workers


Solution

  • I have resolved this issue by applying the following steps

    1. Create Web.Config file in dist folder (created after build)

    2. Add configuration in web.config file

      <configuration>
      <system.webServer>
          <staticContent>
              <mimeMap fileExtension=".webmanifest" mimeType="application/json" />
          </staticContent>
       </system.webServer>