Questions tagged [service-worker-config]
24 questions
5
votes
3 answers
ngsw.json?ngsw-cache-bust failing in offline mode of Angular 8 PWA application
I am facing an issue with the service worker. The service worker is not registering on its own through the app.module. So I am manually registering it in main.ts. It works fine in online mode. But when I change the network to offline mode, getting…

user3036042
- 95
- 1
- 4
3
votes
1 answer
Angular service-worker scope encountered an error during installation
I am trying to use the Angular service worker but I get an error when trying to use it.
Those are my versions:
Angular CLI: 15.2.0
Node: 16.18.1
Package Manager: npm 8.19.2
OS: linux x64
Angular: 15.2.0
... animations, cdk, cli, common, compiler,…

A.Casanova
- 555
- 4
- 16
3
votes
1 answer
Prefetch API calls with service worker
I have setup service worker for my angular app. The caching of the data groups works fine as long as the relevant page that the API call is made is visited. However my goal is to on the load of the application cache the data of all the endpoints…

Clueless
- 109
- 10
2
votes
1 answer
Is it possible to prevent a PWA from using caching on a specific route only?
Since I configured my React app to be a PWA, I started having issues with google authentication.
When the user clicks on sign-in with Google, this endpoint is supposed to be hit:
// @route GET api/users/auth/google
// @desc Authenticate user…

AG_HIHI
- 1,705
- 5
- 27
- 69
2
votes
1 answer
No matching service worker detected - Angular 9
this is my first time working with service workers and I am having difficulties because I always get this error in the Network - Application - Manifest tab:
Some technical details:
package.json
"@angular/animations": "~9.1.0",
"@angular/common":…

Torjescu Sergiu
- 1,483
- 10
- 24
2
votes
1 answer
How to add expiration time to caches with workbox-build generateSW?
I use workbox generateSW method to generate service worker and this is the config I use :
const workbox = require("workbox-build");
workbox.generateSW({
globDirectory: "./",
globIgnores: ["node_modules/**", "**/generator.js", "**/sw.js"],
…

Mehdi Faraji
- 2,574
- 8
- 28
- 76
1
vote
1 answer
Update cache file if last modified is changed in service worker
Is there any way to update file(s) in the service worker if the last modified date time is changed? I have some images that change every 2-3 days and want to let the service worker know to update them.
I separated these images in the cache directory…

M.H.
- 223
- 3
- 10
- 23
1
vote
1 answer
Angular PWA does not work when change to OFFLINE and press Refresh (F5)
I'm using angular to make PWA app.
Angular: 12
What is going on is:
I go to my app (online mode) -> The web app can display properly
Turn on developer console and change connectivity to OFFLINE
Press F5 to reload the application
What…

Redplane
- 2,971
- 4
- 30
- 59
1
vote
1 answer
ServiceWorker script evaluation failed
I have added google code to my service worker but it gives me error in google console...
The error in console Google:
pwaupdate:176 Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://myweb.org/') with script…

siken
- 11
- 1
- 3
1
vote
1 answer
reactjs service worker not found .license file
I'm working on two React projects.
In both projects, the manifest.json file is set up correctly and The serviceworker is also registered.
In one of the projects, the question of adding to the home screen is not asked.
From the research I've done,…

Arman
- 421
- 3
- 10
1
vote
1 answer
angular app with service-worker (pwa) is not working as expected
Working on an offline angular with service workers get the reference from https://angular.io/guide/service-worker-config
Application working fine offline the only issue is with cache update mechanism if i use "installMode": "prefetch" application…

Shailendra Sharma
- 6,976
- 2
- 28
- 48
0
votes
0 answers
Is it possible to prevent a service worker from loading a cached version of the app and hit the server instead?
I have a React PWA created with create-react-app.
The app has Google authentication.
This is the Google sign in button onClick event listener:
onClick={(e) => {
e.preventDefault();
const isLocalhost = Boolean(
…

AG_HIHI
- 1,705
- 5
- 27
- 69
0
votes
0 answers
Service worker not working only in production
I built a PWA and it works/installs fine when in development, but when in production I can't install it and this error comes up in dev tools screenshot of dev tools error, how can I fix it?
My App is hosted on netlify.
I tried putting my service…

Ashwal
- 1
- 1
0
votes
0 answers
Trouble implementing "Network Only then Cache Fallback" strategy on service workers
Well, I've been facing an issue, with a large application, where sometimes I get a blank screen when loading the deployed build.
I've fiddled around with my workbox-config.js, and managed to figure out (maybe it's not true), that increasing the…
0
votes
0 answers
Multiple inbound requests to /assets/workers/null - misconfigured service worker?
We're getting slammed by a multitude of requests from our own clients (known IPs) hitting an endpoint of "/assets/workers/null".
We might see 6000 requests from 25 known IP addresses in a 2 minute window and a handful of requests to this endpoint a…

Brian Riley
- 926
- 1
- 7
- 12