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.
next.config.js
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  /* config options here */
}
 
module.exports = nextConfigAlternatively, you can use next.config.ts for better type safety and auto-completion:
next.config.ts
import type { NextConfig } from 'next'
 
const nextConfig: NextConfig = {
  /* config options here */
}
 
export default nextConfigDeprecated or updated options
Some configuration options have been removed or updated in recent versions of Next.js. For example:
- eslintconfiguration option has been removed from- next.config. Remove the- eslintoption and use the ESLint CLI instead. See the ESLint documentation.
- experimental.turboconfiguration has moved to a top-level- turbopackconfiguration. See the- turbopackoption documentation.
See the next.config.js docs for a list of all available and legacy options.
Useful links
Was this helpful?