{"record":{"id":"809e734d11f9713d","repo":"medusajs/medusa","slug":"model-property-is-missing","errorCode":null,"errorMessage":"'model' property is missing.","messagePattern":"'model' property is missing\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-displays.ts","lineNumber":168,"sourceCode":"        if (!_model) {\n          return\n        }\n\n        model = _model\n        displays = getDisplays(path, model, index, file)\n        hasLink = validateLink(path, file)\n      },\n    })\n  } catch (err) {\n    logger.error(`An error occurred while traversing the file.`, {\n      file,\n      error: err,\n    })\n    return null\n  }\n\n  if (!model) {\n    logger.warn(`'model' property is missing.`, { file })\n    return null\n  }\n\n  if (!hasLink) {\n    logger.warn(`'link' property is missing.`, { file })\n    return null\n  }\n\n  return {\n    import: import_,\n    model,\n    displays,\n  }\n}\n\nfunction getDisplays(\n  path: NodePath<ExportDefaultDeclaration>,\n  model: CustomFieldModel,","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-displays.ts#L150-L186","documentation":"While generating the admin custom-field display configuration, the Vite plugin parses each display file's default export. If the parsed export has no 'model' property (the data model the display attaches to, e.g. \"product\" or an custom model), the file is skipped with this warning — the display will not appear in the admin.","triggerScenarios":"A src/admin/custom-fields/<file>/display.ts (or equivalent) whose default export omits the model property, or exports it under a different key/name so the AST lookup fails.","commonSituations":"Converting a form config to a display config and forgetting model; renaming properties based on outdated docs; destructuring or computed exports the AST parser can't statically read.","solutions":["Open the file named in the warning ({ file }) and add model: \"<model-name>\" to the default export","Make sure the export is a plain object literal with statically readable keys (no spreads/computed keys) so the plugin can parse it","Verify the display config matches the documented shape: { model, link, displays: [...] }"],"exampleFix":"// before (display.ts)\nexport default {\n  link: \"/src/links/product-brand\",\n  displays: [/* ... */],\n}\n\n// after\nexport default {\n  model: \"product\",\n  link: \"/src/links/product-brand\",\n  displays: [/* ... */],\n}","handlingStrategy":"validation","validationCode":"const cfg = displayConfigDefaultExport\nif (!(\"model\" in cfg)) {\n  throw new Error(\"display config is missing 'model' — it will be skipped\")\n}","typeGuard":"const hasDisplayModel = (c: unknown): c is { model: string } =>\n  typeof c === \"object\" && c !== null && typeof (c as any).model === \"string\"","tryCatchPattern":"null","preventionTips":["Start display configs from the official scaffold/template","Keep exports as plain object literals with literal keys","Watch dev-server output for these warnings whenever the admin regenerates"],"tags":["custom-fields","admin-vite-plugin","display-config","build-warning"],"backgroundTag":"invalid-custom-field-config","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}