Google Chrome: DOMException: Registration failed - manifest empty or missing

Fabian H. picture Fabian H. · May 19, 2016 · Viewed 10.6k times · Source

I am trying to implement Push Notifications on my website (using Pushpad). Therefore I created a "manifest.json" with following content:

{
    "gcm_sender_id": "my_gcm_sender_id",
    "gcm_user_visible_only": true
}

of course I created a valid GCM-Account and have a sender id

I put the manifest.json into my root directory and I also added this line to my index.php:

<link rel="manifest" href="/manifest.json">

Using Firefox everything works fine and I can send and receive push notifications (so I think the manifest-include works fine), but Chrome won't work...

The console shows following error:

Uncaught (in promise) DOMException: Registration failed - manifest empty or missing

I searched Google for a long time and tried everything I found, but nothing works.

What I tried:

  1. created the manifest.json with "Editor" and saved it as type All Types (so no hidden .txt-file) and also with UTF-8-Encoding.
  2. restarted Chrome
  3. cleared Chrome's cache, history, etc.

I really hope somebody can help me.

Answer

Sudhanshu picture Sudhanshu · Oct 26, 2016

For me it was a redirect. The manifest.json must return a 200 status code (must be directly available from the server), without any redirects. You can check the response via

wget --max-redirect=0 https://example.com/manifest.json

or

curl https://example.com/manifest.json