shadowwalker / next-pwa

Zero config PWA plugin for Next.js, with workbox 🧰
MIT License
3.86k stars 323 forks source link

Cannot use a custom NextConfig #405

Closed AntoineKM closed 1 year ago

AntoineKM commented 2 years ago

Summary

What can I help with? Please keep this clear and concise.

You might accept custom NextConfig for people which are using Sentry for example, or things like poweredByHeader, so allow all properties

I have this error with my custom NextConfig:

- The root value has an unexpected property, 17, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, red

Versions

How To Reproduce

Steps to reproduce the behavior:

Quick example with poweredByHeader

// next.config.js
module.exports = withPWA({ poweredByHeader: false, });

Expected Behaviors

You gonna have an error like: - The root value has an unexpected property, 0, which is not in the list of allowed properties (poweredByHeader)

Screenshots

image

Additional Context

Work super fine with these versions:

eins78 commented 1 year ago

there is a breaking change (see #411), and the way to use the plugin has changed. adapting your example:

// next.config.js
module.exports = withPWA(/* pwa conf */)({ poweredByHeader: false, });