Open NicoCaldo opened 9 months ago
Everything works fine if I use localhost
but when I try to access my server within the local network using http://my_ip
I got the error. Even from localhost but using any localhost IP (0.0.0.0) and/or (127.0.0.1) the error occurs
It turned out you need your server to run on HTTPS
I have geenrated a self signed certificate on my server matching its IP and loclahost but now the error is
An unknown error occurred when fetching the script.
my_ip/:1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://my_ip:8080/webpush/') with script ('https://my_ip:8080/webpush/service-worker.js'): An unknown error occurred when fetching the script.
Now, in Mozilla works correctly, in Chrome i'm having the issue above
It seems the worker is not loaded in Chrome
Could it be chrome doesn't allow self-signed certificate for web workers?
On Chrome I'm getting an error on line 95 of webpush.js when I try to subscribe with the error
I've correctly created the VAPID key like the documentation describe