invalid-next-config.mdx
title: 'Invalid next.config.js'
Why this error occurred
In your next.config.js file, you passed invalid options that either are the incorrect type or an unknown field. This warning is shown to help catch typos, deprecated or updated options.
Possible ways to fix it
You can use the NextConfig type to help ensure your config is correct.
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */
}
module.exports = nextConfig
Alternatively, you can use next.config.ts for better type safety and auto-completion:
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
/* config options here */
}
export default nextConfig
Deprecated or updated options
Some configuration options have been removed or updated in recent versions of Next.js. For example:
eslintconfiguration option has been removed fromnext.config. Remove theeslintoption and use the ESLint CLI instead. See the ESLint documentation.experimental.turboconfiguration has moved to a top-levelturbopackconfiguration. See theturbopackoption documentation.
See the next.config.js docs for a list of all available and legacy options.
Useful links
Rendered from the public repository vercel/next.js on GitHub; content belongs to its authors. Cached for up to an hour.