Open kawazoe opened 5 years ago
We are getting the same errors reported through bugsnag: undefined is not a function
node_modules/register-service-worker/index.js:47 - registerValidSW
If any information or a fix is possible, would be great.
Same here, also w/ bugsnag
Same here, caught by Sentry/Raven Additional info:
Browser: Chrome version: 74.0.3729 OS: Windows 10 User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Same here, caught by Rollbar
UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
File webpack:///./node_modules/register-service-worker/index.js line 52 col 6 in o .then(function (registration) { File webpack:///./node_modules/register-service-worker/index.js line 43 col 9 in [anonymous] registerValidSW(swUrl, emit, registrationOptions)
Update since July, the exception is caught every now and then and happens across all combinations of users/devices/OS's/browsers. (currently 184 events over 41 users) It's strange that the 'ready' function is defined but 'register' is not, possibly a race condition during the serviceWorker init?
Do you have any real-world web pages to reproduce the error? I can't debug it by just looking at the error messages.
@sodatea I do but since it an app that is meant to be private, I would feel better sharing the link privately. Do you have any other channel we could use for this?
Also, keep in mind that this is happening less that 1% of the time and I have never seen it happening on our machines. It only happened in the wild, and very rarely.
@kawazoe You can find me on discord as sodatea#9125. My email's haoqunjiang@gmail.com.
I've sent you an email with some extra details.
@kawazoe Thanks! I'll have a look.
Any update on this ?
I still can't locate the bug
@sodatea I think that at this point, maybe we should open an issue in webkit? I feel like this is more on their side if the call to register()
returns undefined
.
Yeah, but maybe in Blink instead? As the above-mentioned user-agent strings are all from Chrome.
Chromium bug link: https://bugs.chromium.org/p/chromium/issues/detail?id=1097616
I am getting a weird error on a production application when the service worker is registered. I cannot reproduce it on my own devices and it appear to only happen less than one percent of the time.
Our analytics tells us that some devices gets an "undefined is not a function" at https://github.com/yyx990803/register-service-worker/blob/master/src/index.js#L44 on the
then
call. This seems to indicate that theregister()
call returned undefined which is not valid according to the spec.The devices that trigger those errors are running Android 7, 8 or 8.1 and using Chrome 70, 71 or Samsung Internet 7.4 or 8 or 8.1 so they should have support for service workers. We are also getting calls from those browsers/os that do work fine.
I don't think there is much that can be done on your side beside checking the result of the register call and emiting an error if it's not a promise. Have you even seen this problem before? I can't seem to find anyone complaining about this.