vercel/next.js · error

[Next.js DevTools] Invalid config patch:

Error message

[Next.js DevTools] Invalid config patch:

What it means

saveDevToolsConfig validates the config patch against the zod devToolsConfigSchema before POSTing to /__nextjs_devtools_config; when validation fails it warns with the schema error message and does not send the invalid patch.

Source

Thrown at packages/next/src/next-devtools/dev-overlay/utils/save-devtools-config.ts:33

  fetch('/__nextjs_devtools_config', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body,
    // keepalive in case of fetch interrupted, e.g. navigation or reload
    keepalive: true,
  }).catch((error) => {
    console.warn('[Next.js DevTools] Failed to save config:', {
      data: body,
      error,
    })
  })
}

export function saveDevToolsConfig(patch: DevToolsConfig) {
  const validation = devToolsConfigSchema.safeParse(patch)
  if (!validation.success) {
    console.warn(
      '[Next.js DevTools] Invalid config patch:',
      validation.error.message
    )
    return
  }

  queuedConfigPatch = deepMerge(queuedConfigPatch, patch)

  if (timer) {
    clearTimeout(timer)
  }

  timer = setTimeout(flushPatch, 120)
}

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Fix the DevTools config patch so it matches the expected schema.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/next/src/next-devtools/dev-overlay/utils/save-devtools-config.ts:33 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/3b8f3b5798e7cd31. Report an issue: GitHub.