# Next.js: Invalid next.config.js options detected: Unrecognized key(s) in object: 'xyz'

**Code:** `Invalid next.config.js options detected` · **Category:** Next.js · **Seen on:** Next.js, Node.js

`next.config.js` contains an option Next.js doesn't recognise (typo, wrong version, or moved key).

## Meaning

Compare the key with the docs for your Next version: options move between `experimental` and stable (`serverActions`, `appDir`, `swcMinify`, `serverComponentsExternalPackages` → `serverExternalPackages`). Remove obsolete keys after upgrading. The message names the bad key and the expected structure.

## Common causes

- Typo in a config key
- Option removed/renamed in a newer Next.js
- Option only valid under `experimental`
- Config written for another version
- Incorrect value type

## Quick fix

1. Check the Next.js docs for the option name for your version
2. Move keys out of/into `experimental` as documented
3. Remove stale options after upgrade

## Detailed fix by platform

### Next.js

1. `npx next info` shows the Next.js version and config issues

## How to diagnose

1. **Key** — Named in message?
2. **Version** — Docs for this version?
3. **Location** — experimental?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nextjs/next-config-invalid-options)
