当我想运行我的项目时,我有以下三个警告:
1-
warn - Invalid next.config.js options detected: The root value has an unexpected property, webpack5, which is not in the list of allowed properties (amp, analyticsId, assetPrefix, basePath, cleanDistDir, compiler, compress, crossOrigin, devIndicators, distDir, env, eslint, excludeDefaultMomentLocales, experimental, exportPathMap, future, generateBuildId, generateEtags, headers, httpAgentOptions, i18n, images, onDemandEntries, optimizeFonts, output, outputFileTracing, pageExtensions, poweredByHeader, productionBrowserSourceMaps, publicRuntimeConfig, reactStrictMode, redirects, rewrites, sassOptions, serverRuntimeConfig, staticPageGenerationTimeout, swcMinify, trailingSlash, typescript, useFileSystemPublicRoutes, webpack).
2-
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
3-
warn - ./node_modules/next-i18next/dist/commonjs/serverSideTranslations.js
Critical dependency: the request of a dependency is an expression
这是我的next.config.js
:
const {i18n} = require('./next-i18next.config')
const withVideos = require('next-videos')
module.exports = withVideos({
reactStrictMode : true,
i18n,
webpack5: true,
webpack: (config) => {
config.resolve.fallback = { fs: false };
return config;
},
})
我甚至试过这个:
/**
* @type {import('next').NextConfig}
*/
const {i18n} = require('./next-i18next.config')
const withVideos = require('next-videos')
const nextConfig = {
reactStrictMode : true,
i18n,
webpack5: true,
webpack: (config) => {
config.resolve.fallback = { fs: false };
return config;
},
}
module.exports = withVideos(nextConfig)
结果相同。
1条答案
按热度按时间j9per5c41#
我不知道这是否有用,但我希望如此。
我在使用Google的“自动完成”功能时遇到了同样的问题:
根值具有意外属性autoComplete,该属性不在允许的属性列表中(amp,...
我将它 Package 成一个“env”对象,如下所示:
重新启动我的应用程序后,警告就消失了。