Next-pwa: Couldn't find configuration for either precaching or runtime caching.

Created on 29 Jul 2020  路  6Comments  路  Source: shadowwalker/next-pwa

Summary

Using Next.js v9.5 and next-compose-plugins
Throw the following error:

Couldn't find configuration for either precaching or runtime caching. Please ensure that the various glob options are set to match one or more files, and/or configure the runtimeCaching option.

How To Reproduce

Steps to reproduce the behavior:

  1. Edit next.config.js
const withPlugins   = require('next-compose-plugins');
const PWA           = require('next-pwa');
const sass          = require('@zeit/next-sass');

module.exports      = withPlugins([PWA, { pwa: { dest: 'public' } }, sass]);
  1. See error
bug question

Most helpful comment

Passing runtime caching manually seems to remove that error.

const runtimeCaching = require('next-pwa/cache')

withPWA({
  pwa: {
    runtimeCaching,
  }
})

All 6 comments

Yes, having the same issue after I updated to NextJs 9.5 today.

Passing runtime caching manually seems to remove that error.

const runtimeCaching = require('next-pwa/cache')

withPWA({
  pwa: {
    runtimeCaching,
  }
})

This seems to be the issued caused by next-compose-plugins

This seems to be the issued caused by next-compose-plugins

Noup, I am no longer using next-compose and the error persists

I'm not able to reproduce the errors. The next version 9.5 works fine for my examples. Maybe create a reproduce repository would help.

I'm not able to reproduce the errors. The next version 9.5 works fine for my examples. Maybe create a reproduce repository would help.

Issue disappeared in the later version. I'm using Next.js 10 now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paales picture paales  路  4Comments

rrjanbiah picture rrjanbiah  路  6Comments

efleurine picture efleurine  路  7Comments

harshzalavadiya picture harshzalavadiya  路  3Comments

jonahsnider picture jonahsnider  路  4Comments