{"record":{"id":"fb480ec5b1e2efe9","repo":"vercel/next.js","slug":"config-options-experimental-proxyprefetch-and-e","errorCode":null,"errorMessage":"Config options `experimental.proxyPrefetch` and `experimental.middlewarePrefetch` cannot be set at the same time. Please use `experimental.proxyPrefetch` instead.","messagePattern":"Config options `experimental\\.proxyPrefetch` and `experimental\\.middlewarePrefetch` cannot be set at the same time\\. Please use `experimental\\.proxyPrefetch` instead\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/config.ts","lineNumber":984,"sourceCode":"        'Server Actions Size Limit must be a valid number or filesize format larger than 1MB: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit'\n      )\n    }\n  }\n\n  // Throw if both Middleware and Proxy config are set.\n  if (\n    userConfig.experimental?.proxyClientMaxBodySize !== undefined &&\n    userConfig.experimental?.middlewareClientMaxBodySize !== undefined\n  ) {\n    throw new Error(\n      'Config options `experimental.proxyClientMaxBodySize` and `experimental.middlewareClientMaxBodySize` cannot be set at the same time. Please use `experimental.proxyClientMaxBodySize` instead.'\n    )\n  }\n  if (\n    userConfig.experimental?.proxyPrefetch !== undefined &&\n    userConfig.experimental?.middlewarePrefetch !== undefined\n  ) {\n    throw new Error(\n      'Config options `experimental.proxyPrefetch` and `experimental.middlewarePrefetch` cannot be set at the same time. Please use `experimental.proxyPrefetch` instead.'\n    )\n  }\n  if (\n    userConfig.experimental?.externalProxyRewritesResolve !== undefined &&\n    userConfig.experimental?.externalMiddlewareRewritesResolve !== undefined\n  ) {\n    throw new Error(\n      'Config options `experimental.externalProxyRewritesResolve` and `experimental.externalMiddlewareRewritesResolve` cannot be set at the same time. Please use `experimental.externalProxyRewritesResolve` instead.'\n    )\n  }\n  if (\n    userConfig.skipProxyUrlNormalize !== undefined &&\n    userConfig.skipMiddlewareUrlNormalize !== undefined\n  ) {\n    throw new Error(\n      'Config options `skipProxyUrlNormalize` and `skipMiddlewareUrlNormalize` cannot be set at the same time. Please use `skipProxyUrlNormalize` instead.'\n    )","sourceCodeStart":966,"sourceCodeEnd":1002,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/server/config.ts#L966-L1002","documentation":"Same aliasing pattern as the body-size option: `experimental.middlewarePrefetch` was renamed to `experimental.proxyPrefetch`. The guard at config.ts:980-987 forbids both being set explicitly because the later alias-mapping code would conflict. Use only the new proxy-prefixed key.","triggerScenarios":"Setting both `experimental.proxyPrefetch` and `experimental.middlewarePrefetch` in the same config.","commonSituations":"Partial config migration during a Next.js upgrade. Merging two config files where one used the old name.","solutions":["Delete `experimental.middlewarePrefetch` and keep `experimental.proxyPrefetch`.","Verify the prefetch behavior you intend (proxy prefetch controls preloading of routes through the proxy layer).","Grep the config for any other `middleware*` keys to finish the migration."],"exampleFix":"// before\nmodule.exports = { experimental: { proxyPrefetch: true, middlewarePrefetch: true } }\n// after\nmodule.exports = { experimental: { proxyPrefetch: true } }","handlingStrategy":"validation","validationCode":"const e = config.experimental ?? {};\nif (e.proxyPrefetch !== undefined && e.middlewarePrefetch !== undefined) {\n  throw new Error('set only experimental.proxyPrefetch');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat any `middleware*` experimental key as deprecated; prefer the `proxy*` alias.","Add an ESLint custom rule or config schema validator to flag both keys present."],"tags":["config","proxy","middleware","prefetch","migration","next-config"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}