17

After deleting node modules and package-lock.json, I am getting the above error, when I reload any page. When I restart the project it works fine for the first time. But again when i reload the page, showing a blank page and giving the above error in the console.

enter image description here

next.config.js

    const withSass = require('@zeit/next-sass')
    const withCSS = require('@zeit/next-css');
    const withFonts = require('next-fonts');
    const withPlugins = require('next-compose-plugins');
    const optimizedImages = require('next-optimized-images');

    module.exports = withPlugins([
        [optimizedImages, {
            inlineImageLimit: 8192,
            imagesFolder: 'images',
            imagesName: '[name]-[hash].[ext]',
            handleImages: ['jpeg', 'jpg', 'png', 'svg', 'webp', 'gif', 'ico'],
            optimizeImages: true,
            optimizeImagesInDev: false,
            mozjpeg: {
                quality: 80,
            },
            optipng: {
                optimizationLevel: 3,
            },
            pngquant: false,
            gifsicle: {
                interlaced: true,
                optimizationLevel: 3,
            },
            webp: {
                preset: 'default',
                quality: 75,
            },
        }],
        [withCSS],[withFonts],[withSass]
    ]);
try on
  • 203
  • 1
  • 2
  • 9

1 Answers1

38

Try removing the .next directory. That is what worked for me :)

Jason R Stevens CFA
  • 2,232
  • 1
  • 22
  • 28
Spandan Joshi
  • 809
  • 10
  • 11