We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
offlineStrategy options is not available in generated sw.js file
sw.js
Nuxt version: 2.14.6 Nuxt PWA version: 3.1.0
// nuxt.config.js pwa: { workbox: { dev: true, config: process.env.NODE_ENV !== 'development' ? false : { debug: process.env.NODE_ENV === 'development' }, cleanupOutdatedCaches: true, offline: false, runtimeCaching: [ { urlPattern: 'https://(s3-|s3.)?(.*).amazonaws.com/.*', handler: 'cacheFirst', strategyOptions: { cacheName: 's3', cacheExpiration: { maxEntries: 100, maxAgeSeconds: 3600 } } }, { urlPattern: '/images/.*', handler: 'cacheFirst', strategyOptions: { cacheName: 'images', cacheExpiration: { maxEntries: 20, maxAgeSeconds: 3600 } } }, { urlPattern: '/api/.*', handler: 'networkOnly' } ] } }
Seems like offlineStrategy options is missing in @nuxtjs/pwa/lib/workbox/module.js
@nuxtjs/pwa/lib/workbox/module.js
// Add sw.js if (options.swTemplate) { await this.addTemplate({ src: options.swTemplate, fileName: options.swDest, options: { swOptions: pick(options, [ 'workboxURL', 'importScripts', 'config', 'cacheNames', 'clientsClaim', 'skipWaiting', 'cleanupOutdatedCaches', 'offlineAnalytics', 'preCaching', 'runtimeCaching', 'offlinePage', 'offlineStrategy' // Added missing option ]), routingExtensions: await readJSFiles.call(this, options.routingExtensions), cachingExtensions: await readJSFiles.call(this, options.cachingExtensions), workboxExtensions: await readJSFiles.call(this, options.workboxExtensions) } }) }
The text was updated successfully, but these errors were encountered:
The code block looked like this before: // Add sw.js
if (options.swTemplate) { await this.addTemplate({ src: options.swTemplate, fileName: options.swDest, options: { ...options, routingExtensions: await readJSFiles.call(this, options.routingExtensions), cachingExtensions: await readJSFiles.call(this, options.cachingExtensions), workboxExtensions: await readJSFiles.call(this, options.workboxExtensions) } }) }
therefore it seems legit that it worked before, but doesn't now when pick is used.
Breaks in 3.1.0
Sorry, something went wrong.
I have this error too!
2b9856e
Should be fixed by v3.1.1
No branches or pull requests
offlineStrategy options is not available in generated
sw.js
fileNuxt version: 2.14.6
Nuxt PWA version: 3.1.0
Proposed Solution
Seems like offlineStrategy options is missing in
@nuxtjs/pwa/lib/workbox/module.js
The text was updated successfully, but these errors were encountered: