{"record":{"id":"c0fcae52a5a774e3","repo":"gatsbyjs/gatsby","slug":"warning-property-property-of-exported-config","errorCode":null,"errorMessage":"`${warning.property}` property of exported config in `${functionObj.originalRelativeFilePath}` is misconfigured.\\nExpected object:\\n\\n${warning.expectedType}\\n\\nGot:\\n\\n${warning.original}\\n\\nUsing default:\\n\\n${warning.replacedWith}","messagePattern":"`(.+?)` property of exported config in `(.+?)` is misconfigured\\.\\\\nExpected object:\\\\n\\\\n(.+?)\\\\n\\\\nGot:\\\\n\\\\n(.+?)\\\\n\\\\nUsing default:\\\\n\\\\n(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/internal-plugins/functions/middleware.ts","lineNumber":55,"sourceCode":"type IGatsbyMiddleware = (\n  req: IGatsbyInternalRequest,\n  res: Response,\n  next: NextFunction\n) => Promise<void> | void\n\ninterface ICreateMiddlewareConfig {\n  getFunctions: () => Array<IGatsbyFunction>\n  prepareFn?: (functionObj: IGatsbyFunction) => Promise<void> | void\n  showDebugMessageInResponse?: boolean\n}\n\nexport function printConfigWarnings(\n  warnings: Array<IAPIFunctionWarning>,\n  functionObj: IGatsbyFunction\n): void {\n  if (warnings.length) {\n    for (const warning of warnings) {\n      reporter.warn(\n        `${\n          warning.property\n            ? `\\`${warning.property}\\` property of exported config`\n            : `Exported config`\n        } in \\`${\n          functionObj.originalRelativeFilePath\n        }\\` is misconfigured.\\nExpected object:\\n\\n${\n          warning.expectedType\n        }\\n\\nGot:\\n\\n${JSON.stringify(\n          warning.original\n        )}\\n\\nUsing default:\\n\\n${JSON.stringify(\n          warning.replacedWith,\n          null,\n          2\n        )}`\n      )\n    }\n  }","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/internal-plugins/functions/middleware.ts#L37-L73","documentation":"printConfigWarnings reports that an API function's exported `config` object has a property (e.g. `status`, `headers`, API route config fields) of the wrong shape. Gatsby validates the config, prints expected vs. actual, and falls back to the default value instead of crashing the function.","triggerScenarios":"Thrown at packages/gatsby/src/internal-plugins/functions/middleware.ts:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the exported config property to match the documented expected type","Compare the printed `Got` vs `Expected` blocks to spot the malformed field","Delete the invalid property to rely on the default shown in `Using default`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}