{"record":{"id":"7d4377e8d1ee657b","repo":"medusajs/medusa","slug":"zone-property-is-missing-from-the-widget-config","errorCode":null,"errorMessage":"'zone' property is missing from the widget config.","messagePattern":"'zone' property is missing from the widget config\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/widgets/generate-widgets.ts","lineNumber":146,"sourceCode":"\n  if (!fileHasDefaultExport) {\n    return null\n  }\n\n  let zone: InjectionZone[] | null\n\n  try {\n    zone = await getWidgetZone(ast, file)\n  } catch (e) {\n    logger.error(`An error occurred while traversing the file.`, {\n      file,\n      error: e,\n    })\n    return null\n  }\n\n  if (!zone) {\n    logger.warn(`'zone' property is missing from the widget config.`, { file })\n    return null\n  }\n\n  let idOverride: string | null = null\n\n  try {\n    idOverride = getWidgetIdOverride(ast)\n  } catch (e) {\n    logger.error(`An error occurred while reading the widget id.`, {\n      file,\n      error: e,\n    })\n  }\n\n  const import_ = generateImport(file, index)\n  const widget = generateWidget(zone, index, getWidgetId(idOverride, file))\n\n  return {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/widgets/generate-widgets.ts#L128-L164","documentation":"The widgets generator requires every widget config (created with defineWidgetConfig) to declare a `zone` property telling the admin where to inject the widget. If the parsed config has no zone, the widget cannot be placed and is skipped with this warning.","triggerScenarios":"A file in src/admin/widgets whose config export lacks a `zone` key, e.g. only `{ render: MyWidget }`.","commonSituations":"Widget created from a component file without the config; zone key typo'd as `zones` or `Zone`.","solutions":["Add a valid `zone` property to defineWidgetConfig, e.g. zone: \"product.details.after\"","Pass zone as a string or an array of strings for multiple zones","Restart the dev server"],"exampleFix":"// before\nexport const config = defineWidgetConfig({ render: MyWidget })\n\n// after\nexport const config = defineWidgetConfig({\n  zone: \"product.details.after\",\n})\n\nexport default MyWidget","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"const hasZone = (c: object): c is { zone: string | string[] } =>\n  \"zone\" in c && (typeof (c as any).zone === \"string\" || Array.isArray((c as any).zone))","tryCatchPattern":null,"preventionTips":["Use defineWidgetConfig so the type requires zone","Start widget files from the documented template"],"tags":["admin","widgets","zone","injection"],"backgroundTag":"missing-config-property","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}