khalyomede / gridsome-plugin-service-worker

Registers a service worker and apply your file strategies to let you build a PWA.
https://npmjs.com/package/gridsome-plugin-service-worker
MIT License
8 stars 2 forks source link

Service worker + Bot engine Rich-results error #9

Open braininteractive opened 3 years ago

braininteractive commented 3 years ago

Will be great if we can disable the service worker for bot engine google as some issues getting the rich-results

Error:

Uncaught (in promise) Error: Rejected at ServiceWorkerContainer.wrsParams.serviceWorkers.navigator.serviceWorker.register (:10:852) at /assets/js/service-worker.js:1:3703 at /assets/js/service-worker.js:1:3596 at c.v.L (/assets/js/service-worker.js:1:3657) at /assets/js/service-worker.js:1:2472 STACK TRACE FROM https://search.google.com/test/rich-results

Maybe a simple test of userAgent will do : if (!/google|baidu|bingbot|duckduckbot|teoma|slurp|yandex/i.test(window.navigator.userAgent) && window.navigator.serviceWorker && window.navigator.serviceWorker.register)

khalyomede commented 3 years ago

Hi, thanks for taking your time and raise this issue! I'll take care of it and let you know when it is done. Thank you for your patience.

khalyomede commented 3 years ago

For the record, this person also has the same issue (probably not using Gridsome, but still the same as you are experiencing) on StackOverflow.

braininteractive commented 3 years ago

yes multiple people having the same issue here is one google trend about it, hopefully, can be useful

https://support.google.com/webmasters/thread/12787726?hl=en