cyrilwanner / next-compose-plugins

💡next-compose-plugins provides a cleaner API for enabling and configuring plugins for next.js
MIT License
736 stars 12 forks source link

Invalid next.config.js options detected unexpected property - fallback #62

Open kirillleogky opened 1 year ago

kirillleogky commented 1 year ago
    "next": "^12.3.0",
    "next-auth": "^4.2.1",
    "next-i18next": "^13.0.0",
    "next-progress": "^2.2.0",
    "next-pwa": "^5.6.0",



next.config.js

/** @type {import('next').NextConfig} */
const { i18n } = require('./next-i18next.config');

const withPWA = require('next-pwa')({
  dest: 'public',
  swSrc: 'service-worker.js',
  disable: process.env.NODE_ENV === 'development',
  // cacheOnFrontEndNav: true,
  fallbacks: {
    image: '/assets/default-image.png',
  },
});

const nextConfig = {
  i18n,
  // Due to Material UI styles mismatch
  reactStrictMode: false,
  fallback: true,                                            <--- this prop
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: '**',
      },
    ],
  },

  compiler: {
    emotion: true,
  },

  publicRuntimeConfig: {
     ......
  },

  serverRuntimeConfig: {
    .....
  },

  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/,
      use: ['@svgr/webpack'],
    });

    return config;
  },

  async redirects() {
    return [
      {
        source: '/admin',
        destination: '/admin/performance',
        permanent: true,
      },
      {
        source: '/creator',
        destination: '/creator/episodes',
        permanent: true,
      },
    ];
  },
};

module.exports = withPWA(nextConfig);


Where I need to place fallback: true ?
With "next": "^12.1.5" I didn't have error

image

kachkaev commented 1 year ago

Duplicate of https://github.com/cyrilwanner/next-compose-plugins/issues/59?