workbox-webpack-plugin

PWA doesn't load when router is in history mode (Vue CLI 3 based project)

不羁岁月 提交于 2021-02-18 12:56:09
问题 I have a Vue CLI 3 based app which I would like to function as a PWA. I need it to work in history mode, because the hash intervenes in redirects that I'm doing as part of an OAuth based authentication process. When the routing is in hash mode, the manages to load fine as PWA. Once I change the mode to 'history', the PWA I installed won't load anymore - I'm getting a white screen instead. I checked the browser version and it still works fine (I configured the fallback in my NGINX server to

PWA doesn't load when router is in history mode (Vue CLI 3 based project)

杀马特。学长 韩版系。学妹 提交于 2021-02-18 12:56:06
问题 I have a Vue CLI 3 based app which I would like to function as a PWA. I need it to work in history mode, because the hash intervenes in redirects that I'm doing as part of an OAuth based authentication process. When the routing is in hash mode, the manages to load fine as PWA. Once I change the mode to 'history', the PWA I installed won't load anymore - I'm getting a white screen instead. I checked the browser version and it still works fine (I configured the fallback in my NGINX server to

workbox serviceworker working everywhere except Chrome: Uncaught (in promise) DOMException

我的未来我决定 提交于 2021-02-10 04:22:11
问题 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 workbox-webpack-plugin webpack.config.js const workbox = require('workbox-webpack-plugin'); module.exports = { plugins: [ new workbox.GenerateSW({ swDest: './service-worker.js', skipWaiting: true, clientsClaim: true }) ] } index.ts (entry) if ('serviceWorker' in

workbox serviceworker working everywhere except Chrome: Uncaught (in promise) DOMException

巧了我就是萌 提交于 2021-02-10 04:21:52
问题 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 workbox-webpack-plugin webpack.config.js const workbox = require('workbox-webpack-plugin'); module.exports = { plugins: [ new workbox.GenerateSW({ swDest: './service-worker.js', skipWaiting: true, clientsClaim: true }) ] } index.ts (entry) if ('serviceWorker' in

Can't install service worker of workbox-webpack-plugin in root url for React app, it's installing at localhost:8080/dist

陌路散爱 提交于 2021-01-29 09:57:29
问题 I have been following a lot of tutorials of how to install workbox-webpack-plugin but I haven't succesfully managed to install it correctly. The service worker appears to be installing but its installing in the dist folder of my app (This is my webpacks output path). I think there's nothing wrong with this but when I run my app, there are no errors but the service worker is not functioning and I notice that it is being installed at localhost:8080/dist (The output path) and even if I try to

Webpack workbox Can't find self.__WB_MANIFEST in your SW source

别来无恙 提交于 2020-06-17 15:23:14
问题 I migrate from v4 to v5 of webpack-workbox-plugin but when I try to build, I got error: ERROR in Can't find self.__WB_MANIFEST in your SW source. Child InjectManifest: Asset Size Chunks Chunk Names sw.js 1.5 KiB 0 [emitted] InjectManifest Child html-webpack-plugin for "index.html": 1 asset Do __WB_MANIFEST will create in a precach-manifest file and import automatically like v4? WebpackConfig : new WorkboxPlugin.InjectManifest({ swSrc: 'sw.js', chunks: ['*.chunk.js'], exclude: [/\.(?:png|jpg

Webpack workbox Can't find self.__WB_MANIFEST in your SW source

ぐ巨炮叔叔 提交于 2020-06-17 15:23:13
问题 I migrate from v4 to v5 of webpack-workbox-plugin but when I try to build, I got error: ERROR in Can't find self.__WB_MANIFEST in your SW source. Child InjectManifest: Asset Size Chunks Chunk Names sw.js 1.5 KiB 0 [emitted] InjectManifest Child html-webpack-plugin for "index.html": 1 asset Do __WB_MANIFEST will create in a precach-manifest file and import automatically like v4? WebpackConfig : new WorkboxPlugin.InjectManifest({ swSrc: 'sw.js', chunks: ['*.chunk.js'], exclude: [/\.(?:png|jpg

How to import a script in Service Worker when using Webpack

倖福魔咒の 提交于 2020-05-13 07:36:13
问题 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' failed to load. I have the following code in the Service Worker: importScripts('../src/js/utility.js'); workbox.routing.registerRoute(/.*(?:jsonplaceholder\.typicode)\.com.*$/, function(args){ console.log('Json placeholder being called'); // Send

How to use workbox-webpack-plugin together with Nuxt PWA

那年仲夏 提交于 2020-02-25 04:09:26
问题 I'm currently on Nuxt with PWA Plugin, including workbox module. However if I'm not mistaken this plugin doesn't allow to add the assets generated by webpack to precaching. Is it possible to use workbox-webpack-plugin for only generating the precaching part of the sw.js file? If so, how would it be done? There is some documentation on https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin, however I'm not sure how to apply this to the Nuxt PWA context. 回答1: Turns out