{"record":{"id":"17d9cb6311c124e1","repo":"medusajs/medusa","slug":"model-property-is-missing-17d9cb","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-forms.ts","lineNumber":244,"sourceCode":"          return\n        }\n\n        model = _model\n        hasLink = validateLink(path, file) // Add this line to validate link\n        configs = getConfigs(path, model, index, file)\n        forms = getForms(path, model, index, 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    configs,\n    forms,\n  }\n}\n\nfunction generateCustomFieldConfigName(index: number): string {\n  return `CustomFieldConfig${index}`","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts#L226-L262","documentation":"The forms counterpart to the display generator: when parsing a custom-field form config file, the plugin requires a 'model' property identifying the data model the form attaches to. A missing or unparseable model causes the file to be skipped with this warning, so the form never shows in the admin.","triggerScenarios":"A src/admin/custom-fields/<name>/config.ts (form config) whose default export lacks model, or exports it in a way the static AST parse cannot see (spread, computed key, variable).","commonSituations":"Starting a form config from the display example and forgetting model; renaming after an API change; sharing config objects between files.","solutions":["Add model: \"<model-name>\" to the default export in the file flagged by the warning","Keep the export a plain object literal with statically readable keys","Match the documented form config shape: { model, link, forms: [...] }"],"exampleFix":"// before (config.ts)\nexport default {\n  link: \"./src/links/product-brand\",\n  forms: [/* ... */],\n}\n\n// after\nexport default {\n  model: \"brand\",\n  link: \"./src/links/product-brand\",\n  forms: [/* ... */],\n}","handlingStrategy":"validation","validationCode":"if (typeof cfg.model !== \"string\") {\n  throw new Error(\"form config is missing 'model' — it will be skipped\")\n}","typeGuard":"const hasFormModel = (c: unknown): c is { model: string } =>\n  typeof c === \"object\" && c !== null && typeof (c as any).model === \"string\"","tryCatchPattern":"null","preventionTips":["Scaffold form configs from the documented template with model/link/forms","Keep exports as plain object literals","Check dev-server warnings after adding custom fields"],"tags":["custom-fields","form-config","admin-vite-plugin","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"}