{"record":{"id":"cb9797fcfcafd62d","repo":"medusajs/medusa","slug":"the-injection-zone-zone-is-not-a-core-injecti","errorCode":null,"errorMessage":"The injection zone \"${zone}\" is not a core injection zone. Custom zones are not validated, verify it is correct.","messagePattern":"The injection zone \"(.+?)\" is not a core injection zone\\. Custom zones are not validated, verify it is correct\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-shared/src/extensions/widgets/utils.ts","lineNumber":10,"sourceCode":"import { INJECTION_ZONES } from \"./constants\"\nimport { InjectionZone } from \"./types\"\n\n/**\n * Validates that the provided zone is a valid injection zone for a widget.\n */\nexport function isValidInjectionZone(zone: any): zone is InjectionZone {\n  if (typeof zone !== \"string\") return false\n  if (INJECTION_ZONES.includes(zone as any)) return true\n  console.warn(\n    `The injection zone \"${zone}\" is not a core injection zone. Custom zones are not validated, verify it is correct.`\n  )\n  return true\n}\n","sourceCodeStart":1,"sourceCodeEnd":15,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-shared/src/extensions/widgets/utils.ts#L1-L15","documentation":"isValidInjectionZone validates a widget's injection zone for the Medusa admin widget system. Core zones (from the INJECTION_ZONES list) validate silently; any other string logs this warning and still returns true, because custom zones are permitted but cannot be validated against the known list. It is advisory, not a failure.","triggerScenarios":"Registering an admin widget whose zone is a non-core string (e.g. \"brandDetailCustom\" instead of \"brand.details.side.after\") or a typo of a core zone; the function warns and passes.","commonSituations":"Typos like \"order.details.before\" vs the actual core zone name; using custom injection zones introduced by other plugins; copy-pasting a zone from an outdated example.","solutions":["Check the zone against the official InjectionZone list (via the admin(-shared) types or docs) — a typo'd core zone will silently never render","If the custom zone is intentional (a plugin-defined zone), verify with that plugin's documentation that the string is correct","Silence concern by asserting the zone with the InjectionZone type in TypeScript"],"exampleFix":"// before\nexport const config: WidgetConfig = { zone: \"orders.details.side.after\" } // typo'd\n\n// after\nimport { InjectionZone } from \"@medusajs/admin-shared\"\nexport const config: WidgetConfig = { zone: \"order.details.side.after\" }","handlingStrategy":"type-guard","validationCode":"null","typeGuard":"import { isValidInjectionZone } from \"@medusajs/admin-shared\"\nconst zone: string = config.zone\nif (!isValidInjectionZone(zone)) {\n  throw new Error(`Invalid injection zone: ${zone}`)\n}","tryCatchPattern":"null","preventionTips":["Type the zone as InjectionZone in widget configs so TS catches typos","Cross-check zone strings against the admin widget docs list","Test that the widget actually renders — a wrong custom zone fails silently"],"tags":["admin-widgets","injection-zone","validation","typo-risk"],"backgroundTag":"invalid-injection-zone","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}