{"record":{"id":"8fcfd00458a6711f","repo":"medusajs/medusa","slug":"config-is-missing-a-label","errorCode":null,"errorMessage":"Config is missing a label.","messagePattern":"Config is missing a label\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/routes/generate-menu-items.ts","lineNumber":110,"sourceCode":"}\n\nasync function getMenuItemResults(files: string[]): Promise<MenuItemResult[]> {\n  const results = await Promise.all(files.map(parseFile))\n  return results.filter((item): item is MenuItemResult => item !== null)\n}\n\nasync function parseFile(\n  file: string,\n  index: number\n): Promise<MenuItemResult | null> {\n  const config = await getRouteConfig(file)\n\n  if (!config) {\n    return null\n  }\n\n  if (!config.label) {\n    logger.warn(`Config is missing a label.`, {\n      file,\n    })\n  }\n\n  const import_ = generateImport(file, index)\n  const menuItem = generateMenuItem(config, file, index)\n\n  return {\n    import: import_,\n    menuItem,\n  }\n}\n\nfunction generateImport(file: string, index: number): string {\n  const path = normalizePath(file)\n  return `import { config as ${generateRouteConfigName(index)} } from \"${path}\"`\n}\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/routes/generate-menu-items.ts#L92-L128","documentation":"When generating menu items from route config files (src/admin/routes/**/config.ts-style files or page configs), the plugin reads a `label` used for the sidebar menu entry. A missing label means the menu item would render empty, so the plugin warns (but still generates the item).","triggerScenarios":"A route config object exported without a `label` property, e.g. `export const config = { icon: ... }` in an admin routes directory.","commonSituations":"Route config created from an incomplete snippet; label renamed to `title` or `name` by mistake.","solutions":["Add `label: \"...\"` to the route config export","Use defineRouteConfig to get type checking that flags missing fields","Restart the dev server"],"exampleFix":"// before\nexport const config = { icon: Home }\n\n// after\nexport const config = defineRouteConfig({ label: \"Home\", icon: Home })","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"const hasLabel = (c: unknown): c is { label: string } =>\n  typeof c === \"object\" && c !== null && typeof (c as any).label === \"string\" && (c as any).label.length > 0","tryCatchPattern":null,"preventionTips":["Use defineRouteConfig(...) so TypeScript enforces the config shape","Always include a human-readable label for menu items"],"tags":["admin","routes","menu","label"],"backgroundTag":"missing-config-property","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}