2

So the new or current naming convention for having a site manifest in a PWA is site.webmanifest so I changed the manifest.json that I had to this new naming convention. Updated the <link rel="manifest"> tag to point to the new name. It's in the same exact location, only thing that changed was the name.

I get two errors in dev tools console. First is 404 the site.webmanifest is not found. The second is stating that there's an unexpected token in Line: 1, Column 1 within the site.webmanifest so I'm stumped.

If I change the site.webmanifest back to manifest.json and update the <link> tag from above, it works again. But site.webmanifest does not.

Any ideas with what I'm not understanding?

Daniel Jackson
  • 1,036
  • 1
  • 11
  • 35
  • Try adding this to your manifest link: type='application/manifest+json' see: https://www.w3.org/TR/appmanifest/#media-type-registration – Mathias May 24 '19 at 11:02
  • I tried that and I'm shown there's no manifest found. Only when I do rel="manifest" is the file picked up either way I named it. Only site.webmanifest naming gives the above issue. – Daniel Jackson May 25 '19 at 02:29

2 Answers2

1

Your web server may not recognize the extension .webmanifest and return the file with the media type application/octet-stream. This media type would be incorrect. Citing the MDN documentation :

Manifests should be served using the application/manifest+json MIME type. However, it is optional to do so.

Janaka-Steph
  • 101
  • 1
  • 8
1

As suggested in the top answer is probably a problem with MIME tyle.

I had the same problem on the IIS server.

Just add the file suffix and MIME type in the project web.config:

 <remove fileExtension=".webmanifest" />
 <mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />

to <staticContent> section...

Reference: https://stackoverflow.com/a/49566447 and https://stackoverflow.com/a/53209327/2504578

Hope this helps somebody.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
BRap
  • 529
  • 2
  • 10
  • 29