PHP Classes

SyntaxError: Unexpected end of JSON

Recommend this page to a friend!

      PHP Web Push Notifications Server  >  All threads  >  SyntaxError: Unexpected end of JSON  >  (Un) Subscribe thread alerts  
Subject:SyntaxError: Unexpected end of JSON
Summary:no subscriber
Messages:2
Author:zetapi
Date:2020-12-16 18:59:54
 

  1. SyntaxError: Unexpected end of JSON   Reply   Report abuse  
Picture of zetapi zetapi - 2020-12-16 18:59:54
Got always that message after trying to subscribe
PNServiceWorker.js:38 Serviceworker: activate event

SaveSubscription failed with: SyntaxError: Unexpected end of JSON input PNServiceWorker.js:54

Network (is blank no response) also shows:
Request Method: POST
Status Code: 500 Internal Server Error
Remote Address: "IP.IP.IP.IP":443
Referrer Policy: strict-origin-when-cross-origin

What's wrong?
Thak you in advance

  2. Re: SyntaxError: Unexpected end of JSON   Reply   Report abuse  
Picture of Stefan Kientzler Stefan Kientzler - 2020-12-17 10:48:20 - In reply to message 1 from zetapi
Hi zetapi,

unfortunately you do not provide any information about the system you are working on (server, browser ...).
In any case, the problem is related to the 'cross-origin' settings, as the HTTP request to the server is already rejected.

If you work on a local server you may find further information here:
medium.com/@siddhartha.ng/disable-c ...

Otherwise, you can search the net using the keyword 'strict-origin-when-cross-origin' to find further approaches to narrowing down or solving the problem.

Stefan