删除节点模块和 package-lock.json 后,当我重新加载任何页面时,出现上述错误。 当我重新启动项目时,它第一次运行良好。但是当我重新加载页面时,显示一个空白页面并在控制台中出现上述错误。
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]
]);
答案 0 :(得分:1)
删除 .next 文件夹。它适合我:)