Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

Uncaught (in promise) DOMException: Registration failed - push service error #315

Closed
lukasag opened this issue Apr 20, 2016 · 14 comments
Closed

Comments

@lukasag
Copy link
Contributor

lukasag commented Apr 20, 2016

Getting this on Chrome for Windows and Chrome for Android in latest versions of both browsers. It works normally on Firefox... Sometimes I also get another error together with it that I think it belongs to a function in your plugin..

undefined:1 Uncaught (in promise) DOMException: Registration failed - push service error
/wp-admin/admin-ajax.php?action=wpswmgr_serve&_wpswmanager=wpswmanager%2Fsw%2Fsw%40%2F:1 GET https://www.gameprosa.com.br/wp-admin/admin-ajax.php?action=wpswmgr_serve&_wpswmanager=wpswmanager%2Fsw%2Fsw%40%2F net::ERR_FILE_EXISTS

It's running on https://www.gameprosa.com.br
Everything is properly set, including GCM settings on my manifest.json file

@marco-c
Copy link
Collaborator

marco-c commented Apr 20, 2016

I've never seen this error, it could be somehow related to https://bugs.chromium.org/p/chromium/issues/detail?id=464365.

@marco-c
Copy link
Collaborator

marco-c commented Apr 20, 2016

Looks like you have two <link rel="manifest" in your page.
The plugin is adding <link rel="manifest" href="https://www.gameprosa.com.br/wp-content/uploads/wpservefile_files/manifest.json">.
Are you adding <link rel="manifest" href="/manifest.json?v=kPPJxwmvjB"> manually?

@lukasag
Copy link
Contributor Author

lukasag commented Apr 21, 2016

I didnt noticed your plugin adds a manifest. I have my own manifest file with my icons and web app settings. How about an option to disable the plugin generated manifest? I'll try disabling in the plugin code to see if the problem gets solved, I'll reply again within the next hours.

@marco-c
Copy link
Collaborator

marco-c commented Apr 21, 2016

You just need to comment out the line $manifestGenerator = Mozilla\WebAppManifestGenerator::getInstance(); in wp-web-push-main.php.

If this fixes your problem, I'll add an option to disable the generation of the manifest.

@lukasag
Copy link
Contributor Author

lukasag commented Apr 21, 2016

Marco, it did not fixed the problem.
Please check on https://www.gameprosa.com.br

Only one manifest file loading, still getting the "Uncaught (in promise) DOMException: Registration failed - push service error" error located at undefined, line 1. Unefined drives crazy, how can I properly debug this?

@marco-c
Copy link
Collaborator

marco-c commented Apr 21, 2016

The sender ID is usually a number, are you sure gameprosa-1285 is correct?

@marco-c
Copy link
Collaborator

marco-c commented Apr 21, 2016

image12

@lukasag
Copy link
Contributor Author

lukasag commented Apr 21, 2016

My Dev. Console is different than yours. It does not have this content block and the overall design is pretty different. I've already tried to get to this same panel by going to this https://console.developers.google.com/home/dashboard URL but it always redirects me to https://console.developers.google.com/apis/
For this project the URL is https://console.developers.google.com/apis/library?project=gameprosa-1285
Even the page that shows all my projects is different and the only IDs it shows for my projects are like this one I am using.
Call me on Skype (lukasfire) if you want me to share my screen with you so you can see it, it's definitely weird.

@marco-c
Copy link
Collaborator

marco-c commented Apr 21, 2016

@marco-c
Copy link
Collaborator

marco-c commented Apr 21, 2016

I filed google/WebFundamentals#2847 to update the Google documentation.

@lukasag
Copy link
Contributor Author

lukasag commented Apr 21, 2016

I fixed it, it was all my mistake. The page at Google Developer Console has another menu on the top-left corner where I didn't noticed a button to change from the API Manager to the Developer Console (which I tough i was already in because of the page name). The whole thing is confusing, you are inside a page with a name that is not that actual page but is part of it. Or I need to drink some less coffee and get into this "sleep 8 hours a day" routine.

The link you sent was also redirecting me to the API page. Now that I got to it from the menu I said, when I go back to the API page it shows me a buch of other links in this same menu that were not displaying before... (wtf Google! Really, WTF!?)

@marco-c marco-c closed this as completed Apr 21, 2016
@lukasag
Copy link
Contributor Author

lukasag commented Apr 21, 2016

Thanks Marco, sorry for wasting your time with this. The plugin is now working normally.
But the "enable manifest" button should be there because it will definitely cause problems to people who have their own manifest files. I also added a crossorigin="use-credentials" parameter to my manifest link.

@marco-c
Copy link
Collaborator

marco-c commented Apr 21, 2016

No worries, it was useful because I wouldn't have noticed that the documentation was outdated otherwise. Let's hope it's going to be fixed soon!

I'm going to file a new issue for the manifest thing.

@challenger532
Copy link

challenger532 commented Jan 12, 2018

@lukasag hello, how did you solve it, I'm stuck with the same bug... wasted hours on that.. no result!
the same code is working on the browser, but when running with electron, I'm getting this bug...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants