Questions tagged [workbox-webpack-plugin]
130 questions
20
votes
2 answers
How can I customize my Service Worker based on environment variables?
Edit: This looks like a duplicate of this Unresolved Question.
Do I mark this as answered, or delete?
I am using InjectManifest from workbox-webpack-plugin inside a Vue CLI 3 app. The custom service worker that I am injecting into has handling for…
![](../../users/profiles/1408787.webp)
Madbarron
- 305
- 2
- 8
11
votes
1 answer
Checking for service worker updates in a single page app
We have a signal page application that has Service worker installed and active.
Now our server rebuilds the app, Service worker file is being updated on the server side.
Our client has no idea about this new Service worker file and it is still…
![](../../users/profiles/5288080.webp)
Sandeep Sharma
- 1,537
- 2
- 12
- 33
11
votes
0 answers
Apollo offline first support: Service Worker or Persisted Cache?
I have a react app that use apollo as a grapql client.
The app now need offline support for a subset/subapp.
There is a service worker (thanks to workbox and webpack) that do the pre-caching of the assets of the app and works good.
Now there is a…
![](../../users/profiles/463049.webp)
matiasfha
- 1,220
- 4
- 23
- 42
10
votes
1 answer
How to use Laravel Mix and WorkBox?
I'm trying to build a PWA for my app; and have spent almost 48 hours trying to figure out how to make use of Workbox with Laravel Mix. What's ironical is that Google says Workbox is meant to make things easy!
Buh!
Okay, so far I've figured out that…
![](../../users/profiles/9268302.webp)
TheBigK
- 319
- 2
- 9
8
votes
1 answer
Read env variable from service worker file using workbox
I'm working with workbox-sw and workbox-webpack-plugin
My src sw.js file at root folder (same level with my .env file)
How can I get env variables and accessing it into my src sw.js file
This is from my webpack.config.js
new workboxPlugin({
…
![](../../users/profiles/7119412.webp)
M.Tae
- 1,219
- 1
- 10
- 21
7
votes
0 answers
Workbox conflicting cache entries when running locally in development
When using the Workbox Webpack Plugin in development mode (locally), I get the following service worker error:
PrecacheController.mjs:62 Uncaught add-to-cache-list-conflicting-entries: Two of the entries passed to…
![](../../users/profiles/726766.webp)
shennan
- 8,669
- 5
- 32
- 56
6
votes
0 answers
workbox on https://localhost: fails to fetch random assets
I've got an express server with a self-signed SSL which just serves assets for SPA frontend. When i visit https://localhost:8433 application stats up and successfully fetches all requried assets. However at the same time app's service worker…
![](../../users/profiles/5391766.webp)
ZenDD
- 776
- 1
- 6
- 16
5
votes
1 answer
How to get workboxPlugin.InjectManifest to work with Webpack?
I followed the steps at https://developers.google.com/web/tools/workbox/guides/using-bundlers but the dist/sw.js file after being built was not processed by Webpack at all. All the import statements are still there left untouched, comments are not…
![](../../users/profiles/35634.webp)
Henry
- 31,972
- 19
- 112
- 214
5
votes
4 answers
How to import a script in Service Worker when using Webpack
In a Service Worker, I'm trying to import another helper script using importScripts, however I keep getting a Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:5000/src/js/utility.js'…
![](../../users/profiles/11344935.webp)
Diatosta
- 71
- 1
- 4
5
votes
1 answer
workbox-webpack-plugin & Angular. How to listen to broadcastUpdate event in Angular
I'm trying to use service-worker with my Angular Application. It is build using webpack.
I use workbox-webpack-plugin. I want to serve my GET API calls form cache and in the background update the data.
FOr this, I use the option runtimeCaching with…
![](../../users/profiles/4834117.webp)
Tonio
- 2,473
- 25
- 48
5
votes
1 answer
registerNavigationRoute: precached index.html is not updated NetworkFirst
Context
I have a SPA that use webpack, vueJS and Workbox. In the service-worker, I have the following lines ():
workbox.precaching.precache([
'/index.html'
])
workbox.routing.registerNavigationRoute('/index.html', {
blacklist: [
/.*\.css/,
…
![](../../users/profiles/6151730.webp)
Victor Castro
- 1,123
- 11
- 35
4
votes
1 answer
precacheAndRoute got error on addToCacheList
I have created PWA and implementef workbox using workbox-webpack-plugin.
I got error when i tried to precache the files.
the error that i got (see image below)
Console output
sw.js:1 Uncaught TypeError: e is not iterable
at d.addToCacheList…
![](../../users/profiles/4263693.webp)
Kevin Yl
- 41
- 1
4
votes
1 answer
How to you modify the precache manifest file generated by Workbox? Need urls to have preceding '/'
In the generated precache-manifest.*.js file the URLs all reference relative paths when I need absolute since my app will have some sub-directories as well.
Example of generated file:
self.__precacheManifest = (self.__precacheManifest ||…
![](../../users/profiles/2785342.webp)
shparkison
- 813
- 1
- 8
- 20
4
votes
2 answers
PWA: No matching service worker detected. You may need to reload the page
I get this warning:
No matching service worker detected. You may need to reload the page,
or check that the service worker for the current page also controls
the start of the URL from the manifest.
The thing that my service worker is…
![](../../users/profiles/7009480.webp)
Philipp Mochine
- 3,205
- 4
- 26
- 52
4
votes
3 answers
workbox serviceworker working everywhere except Chrome: Uncaught (in promise) DOMException
Workbox is not working on Chrome, but it works everywhere else,
which is ironic since I believe this is a Google library,
the error that shows is :
Uncaught (in promise) DOMException : sw.js line 1
Chrome:
Opera
Firefox
I'm using the…
![](../../users/profiles/3531149.webp)
user3531149
- 1,409
- 1
- 27
- 46