{"record":{"id":"cc02a38334868c1a","repo":"medusajs/medusa","slug":"zone-property-at-index-j-in-the-displays-pr","errorCode":null,"errorMessage":"'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'.","messagePattern":"'zone' property at index (.+?) in the 'displays' property is not a string literal\\. 'zone' must be a string literal, e\\.g\\. 'general' or 'attributes'\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-displays.ts","lineNumber":232,"sourceCode":"  displayProperty.value.elements.forEach((element, j) => {\n    if (!isObjectExpression(element)) {\n      return\n    }\n\n    const zoneProperty = element.properties.find(\n      (p) => isObjectProperty(p) && isIdentifier(p.key, { name: \"zone\" })\n    ) as ObjectProperty | undefined\n\n    if (!zoneProperty) {\n      logger.warn(\n        `'zone' property is missing at the ${j} index of the 'displays' property.`,\n        { file }\n      )\n      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","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-displays.ts#L214-L250","documentation":"The zone value of a displays entry must be a string literal in the source AST (e.g. \"general\"), because the code generator embeds it statically into generated output. If zone is a variable, template literal, constant reference, or other expression, the entry is skipped with this warning.","triggerScenarios":"Writing zone: MY_ZONE, zone: `general`, or zone: getZone() in a displays entry — anything that is not a plain double/single-quoted string in the config file.","commonSituations":"Wanting to DRY zones into constants; template literals with no interpolation; porting configs written in a more dynamic style.","solutions":["Replace the expression with a plain string literal, e.g. zone: \"general\"","If you need reuse, inline the final string per entry — the plugin only understands literals","Remove backticks/template-literal syntax around the value"],"exampleFix":"// before\nconst ZONE = \"general\"\ndisplays: [{ zone: ZONE, component: \"/src/...\" }]\n\n// after\ndisplays: [{ zone: \"general\", component: \"/src/...\" }]","handlingStrategy":"validation","validationCode":"null","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Write zone values as plain string literals, never variables or template literals","Keep configs simple — the generator is a static AST reader, not a runtime evaluator"],"tags":["custom-fields","display-config","string-literal","ast-parsing"],"backgroundTag":"invalid-custom-field-config","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}