简体   繁体   中英

Vercel Next js Uncaught (in promise) ChunkLoadError: Loading chunk 0 failed

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.

在此处输入图像描述

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]
    ]);

Remove.next folder. its work's for me:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM