Giter Club home page Giter Club logo

so-pwa's Issues

ServiceWorker fails to register in live demo

The live demo currently produces the following errors in the Chrome console:

VM24 workbox-cache-expiration.dev.js:521 Uncaught TypeError: quota_mjs.registerCallback is not a function
Plugin @ VM24 workbox-cache-expiration.dev.js:521
(anonymous) @ service-worker.js:63
(anonymous) @ service-worker.js:65
(index):1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker: ServiceWorker script evaluation failed

This appears to be caused by a recent commit in which purgeOnQuotaError was set to true, causing this failing code path to become active.

Periodic Background Sync not working (official demo)

Hi, I'm trying to implement periodic background sync on a service worker following the steps in this documentation:
https://web.dev/periodic-background-sync/
I also installed the demo, but so far I haven't seen the periodicsync event fired not even once.

It does work though if I click "sync manually" or if I trigger the tag from devtools. But it doesn't work periodically.
I've read that browsers can decide when to sync, but I'm not able to reproduce the behaviour in any way.
Is there a bug or am I missing something?

A couple of things that could be useful: I checked the status and it's "granted". I checked the active tags and I can see the one I registered.

There are also two questions on StackOverflow (unanswered) about this.
https://stackoverflow.com/questions/66649131/periodic-background-sync-not-working-on-pwa-official-api-demo-broken
https://stackoverflow.com/questions/65096834/periodic-sync-not-fired-in-service-worker

I guess I can't simply call a setInterval inside a service worker because it's going to be shut after a while. For the same reason, I guess that a WebSocket wouldn't work either.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.