{"record":{"id":"e315cf5c50dfb5eb","repo":"medusajs/medusa","slug":"zone-is-invalid-at-index-j-in-the-displays","errorCode":null,"errorMessage":"'zone' is invalid at index ${j} in the 'displays' property. Received: ${zone}.","messagePattern":"'zone' is invalid at index (.+?) in the 'displays' property\\. Received: (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-displays.ts","lineNumber":246,"sourceCode":"      return\n    }\n\n    if (!isStringLiteral(zoneProperty.value)) {\n      logger.warn(\n        `'zone' property at index ${j} in the 'displays' property is not a string literal. 'zone' must be a string literal, e.g. 'general' or 'attributes'.`,\n        { file }\n      )\n      return\n    }\n\n    const zone = zoneProperty.value.value\n    const fullPath = getDisplayEntryPath(model, zone)\n\n    if (\n      !isValidCustomFieldDisplayZone(zone) ||\n      !isValidCustomFieldDisplayPath(fullPath)\n    ) {\n      logger.warn(\n        `'zone' is invalid at index ${j} in the 'displays' property. Received: ${zone}.`,\n        { file }\n      )\n      return\n    }\n\n    const componentProperty = element.properties.find(\n      (p) => isObjectProperty(p) && isIdentifier(p.key, { name: \"component\" })\n    ) as ObjectProperty | undefined\n\n    if (!componentProperty) {\n      logger.warn(\n        `'component' property is missing at index ${j} in the 'displays' property.`,\n        { file }\n      )\n      return\n    }\n","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-displays.ts#L228-L264","documentation":"After extracting the zone string and computing the generated display entry path, the plugin validates the zone against the custom-field display zone whitelist and the path shape. An unknown zone or an invalid derived path skips the entry with this warning, echoing the received zone value.","triggerScenarios":"A zone value that is a valid string literal but not one of the recognized custom-field display zones (e.g. \"brandHeader\" or a typo like \"genral\"), producing an invalid entry path.","commonSituations":"Using core widget injection-zone names that aren't display zones; assuming any custom zone works for displays (unlike widgets, display zones are validated); typos.","solutions":["Replace the zone with one of the supported custom-field display zones shown in the docs (e.g. \"general\", \"attributes\") — see isValidCustomFieldDisplayZone's accepted list","Check the exact spelling/casing of the zone in the flagged entry (index j in the warning)","If you intended a fully custom zone, use the widget system instead, which permits custom zones with a warning"],"exampleFix":"// before\ndisplays: [\n  { zone: \"product-header\", component: \"/src/...\" },\n]\n\n// after\ndisplays: [\n  { zone: \"general\", component: \"/src/...\" },\n]","handlingStrategy":"validation","validationCode":"import { isValidCustomFieldDisplayZone } from \"@medusajs/admin-vite-plugin\"\nif (!isValidCustomFieldDisplayZone(zone)) {\n  throw new Error(`Unsupported display zone: ${zone}`)\n}","typeGuard":"const isSupportedZone = (z: string) =>\n  [\"general\", \"attributes\"].includes(z) // keep in sync with supported list","tryCatchPattern":"null","preventionTips":["Use only documented custom-field display zones","Remember display zones are strictly validated, unlike widget injection zones","Watch the dev-server log to catch the received-zone echo when testing new zones"],"tags":["custom-fields","display-config","injection-zone","validation"],"backgroundTag":"invalid-custom-field-config","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}