{"record":{"id":"4310d6a028baf84e","repo":"hcengineering/platform","slug":"failed-to-find-editor-popup-for-typeclass-id","errorCode":null,"errorMessage":"failed to find editor popup for ${typeClass._id}","messagePattern":"failed to find editor popup for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/view-resources/src/actionImpl.ts","lineNumber":526,"sourceCode":"    props?: Record<string, any>\n  }\n): Promise<void> {\n  const docs = Array.isArray(doc) ? doc : doc !== undefined ? [doc] : []\n  evt.preventDefault()\n  let cprops = {\n    ...(props?.props ?? {})\n  }\n  if (docs.length === 1) {\n    const client = getClient()\n    const hierarchy = client.getHierarchy()\n    const doc: Doc = docs[0]\n    const attribute = hierarchy.getAttribute(doc._class, props.attribute)\n\n    const typeClass = hierarchy.getClass(attribute.type._class)\n    const attributeEditorMixin = hierarchy.as(typeClass, view.mixin.AttributeEditor)\n\n    if (attributeEditorMixin?.popup === undefined) {\n      throw new Error(`failed to find editor popup for ${typeClass._id}`)\n    }\n\n    const editor: AnySvelteComponent = await getResource(attributeEditorMixin.popup)\n\n    cprops = {\n      ...cprops,\n      ...{\n        value: (doc as any)[props.attribute]\n      }\n    }\n\n    if (editor !== undefined) {\n      const identifier = await getObjectId(doc, hierarchy)\n      showPopup(\n        editor,\n        cprops,\n        {\n          getBoundingClientRect: () => new DOMRect((evt as MouseEvent).clientX, (evt as MouseEvent).clientY)","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/plugins/view-resources/src/actionImpl.ts#L508-L544","documentation":"ShowEditor resolves the attribute's editor configuration from the view.mixin.AttributeEditor mixin on the attribute's type class and throws when the popup property is undefined. The action only supports opening editors defined as popups; a type without a registered popup editor cannot be edited inline. It is a model/configuration gap rather than a runtime failure.","triggerScenarios":"Invoking the ShowEditor action (e.g. click-to-edit on a table cell) for an attribute whose type class has no AttributeEditor mixin popup registered in the view model.","commonSituations":"Adding a custom attribute/type without registering an editor popup; typo in the editor resource ref; third-party plugin types lacking editor definitions; using ShowEditor on non-editable presentation attributes.","solutions":["Register an AttributeEditor popup for the type class in the view model (view.mixin.AttributeEditor with popup pointing to a Svelte component).","Use an editor action appropriate for the attribute type instead of ShowEditor.","Check that the plugin providing the editor is installed and its resources are loaded.","Verify attribute props.attribute matches a type that supports popup editing."],"exampleFix":"// before\nsetAttributeEditor(typeClass) // no popup registered\n// after\nawait client.createDoc(view.mixin.AttributeEditor, core.space.Model, {\n  attachedTo: typeClass._id,\n  popup: myPlugin.component.EditorPopup\n} as AttributeEditor)","handlingStrategy":"validation","validationCode":"const attr = hierarchy.getAttribute(doc._class, props.attribute)\nconst mixin = attr && hierarchy.as(hierarchy.getClass(attr.type._class), view.mixin.AttributeEditor)\nif (mixin?.popup === undefined) console.warn(`No popup editor for ${props.attribute}; skipping inline edit`)","typeGuard":"function hasPopupEditor(h: Hierarchy, cls: Ref<Class<Doc>>, attr: string): boolean {\n  const a = h.getAttribute(cls, attr)\n  return a !== undefined && h.as(h.getClass(a.type._class), view.mixin.AttributeEditor)?.popup !== undefined\n}","tryCatchPattern":"try { await showEditor(doc, props) } catch (e) { if (e.message.includes('editor popup')) openDefaultForm(doc); else throw e }","preventionTips":["Register AttributeEditor popups for every editable type","Verify editor resources resolve at startup","Only enable inline edit where a popup editor exists"],"tags":["configuration","editor","view-model"],"backgroundTag":"missing-editor-registration","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}