Feeling stressed? I use Miracle of Mind daily.Try it now!

Next.js Config Validator

Validate Next.js configuration files, check for deprecated options, and generate valid configs.

What is the Next.js Config Validator?

The Next.js Config Validator is a free browser-based tool that parses the contents of your next.config.js object and flags structural mistakes before you run a build. It evaluates the configuration locally in your browser, so nothing you paste is uploaded or stored on a server.

It checks several common options for the correct type and shape: reactStrictMode and swcMinify must be booleans, images.domains must be an array, and redirects must be a function rather than a plain value. It also surfaces informational notes, such as flagging experimental.optimizePackageImports as enabled by default in newer Next.js versions.

The validator accepts the config object directly or wrapped in module.exports = or export default, so you can paste straight from a CommonJS or ES Module config file without editing it first.

How to use the Next.js Config Validator

  1. 1Open the tool and paste the object portion of your next.config.js into the configuration text area, or pick one of the built-in examples.
  2. 2Keep or remove the module.exports = or export default prefix; the validator strips either one automatically.
  3. 3Click Validate Configuration to parse the object and run the property checks.
  4. 4Review the validation results: red entries are type errors, blue entries are informational notes, and a success message appears when no problems are found.
  5. 5Fix any flagged fields in your real config file, then re-validate. Press Ctrl+L to clear the input and start over.

What you can use it for

  • Catching a typo where reactStrictMode or swcMinify was set to a string instead of a boolean before a build fails.
  • Confirming that images.domains is an array of strings rather than a single string value.
  • Verifying that redirects is written as an async function and not accidentally assigned an array directly.
  • Reviewing a config inherited from another developer to understand which options are set and whether their types are valid.
  • Spotting deprecated or now-default experimental flags that no longer need to be declared explicitly.

Key features

  • Parses both raw config objects and files wrapped in module.exports or export default.
  • Type checks reactStrictMode, swcMinify, images.domains, and redirects against their expected shapes.
  • Separates output into error, warning, and informational severities for clearer triage.
  • Runs entirely client-side with no signup and no data leaving your browser.

Frequently asked questions

What does the Next.js config validator check?

It parses your next.config.js object and verifies the types of common options. It confirms reactStrictMode and swcMinify are booleans, images.domains is an array, and redirects is a function. It also reports informational notes about options that are now defaults in newer Next.js versions.

Is the Next.js Config Validator free to use?

Yes. The tool is completely free, requires no account, and runs entirely in your browser. The configuration you paste is parsed locally and is never sent to a server.

Can I paste a full next.config.js file?

You should paste the configuration object itself. The validator automatically strips a leading module.exports = or export default prefix, but it does not evaluate import statements or other surrounding file code.

Why does the validator say my configuration is valid when a build still fails?

The tool checks a focused set of common options for correct types and shapes. It does not replicate the full Next.js schema, so build errors caused by plugins, webpack customizations, or untested options can still occur. Treat it as a quick sanity check rather than a complete build replacement.

Does the tool support both CommonJS and ES Module config files?

Yes. Whether your file uses module.exports = or export default, the validator removes that prefix and parses the remaining object the same way.

What does the informational note about optimizePackageImports mean?

If your config sets experimental.optimizePackageImports, the validator flags it as an informational note because that optimization is enabled by default in Next.js 13.5 and later. The note signals you may be able to remove the explicit flag.

0 views views