Skip to content

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

@kirillleogky

Description

@kirillleogky
    "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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions