{"record":{"id":"aa654dbd2c3635d1","repo":"ianstormtaylor/slate","slug":"no-hyperscript-creator-found-for-tag-tagname","errorCode":null,"errorMessage":"No hyperscript creator found for tag: <${tagName}>","messagePattern":"No hyperscript creator found for tag: <(.+?)>","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/slate-hyperscript/src/hyperscript.ts","lineNumber":83,"sourceCode":"\n  const jsx = createFactory(creators)\n  return jsx\n}\n\n/**\n * Create a Slate hyperscript function with `options`.\n */\n\nconst createFactory = <T extends HyperscriptCreators>(creators: T) => {\n  const jsx = <S extends keyof T & string>(\n    tagName: S,\n    attributes?: Object,\n    ...children: any[]\n  ): ReturnType<T[S]> => {\n    const creator = creators[tagName]\n\n    if (!creator) {\n      throw new Error(`No hyperscript creator found for tag: <${tagName}>`)\n    }\n\n    if (attributes == null) {\n      attributes = {}\n    }\n\n    if (!isObject(attributes)) {\n      children = [attributes].concat(children)\n      attributes = {}\n    }\n\n    children = children.filter(child => Boolean(child)).flat()\n    const ret = creator(tagName, attributes, children)\n    return ret\n  }\n\n  return jsx\n}","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/ianstormtaylor/slate/blob/72a37c701e5da4bb13a305d416d9c070d19d3a45/packages/slate-hyperscript/src/hyperscript.ts#L65-L101","documentation":"Thrown by the hyperscript jsx() function when the requested tag name has no registered creator. The creators object (defaults plus custom elements) defines which tags are usable; anything else is rejected.","triggerScenarios":"Calling jsx('mytag', ...) or <mytag> in hyperscript JSX without registering it via createHyperscript({ creators: { mytag: ... } }) or elements: { mytag: {...} }.","commonSituations":"Using custom block types in tests without extending the hyperscript factory; typos in tag names; using slate-hyperscript's default tags while assuming custom schema types exist.","solutions":["Register the tag: createHyperscript({ elements: { mytag: { type: 'my-type' } } })","Use the built-in tags only (<element>, <text>, <editor>, <selection>, <anchor>, <focus>, <cursor>, <selection>)","Check for typos in the tag name against the creators object"],"exampleFix":"// before\nconst jsx = createHyperscript(hyperscriptCreators)\n// after\nconst jsx = createHyperscript({\n  ...hyperscriptCreators,\n  elements: { mytag: { type: 'my-type' } },\n})","handlingStrategy":"validation","validationCode":"const jsx = createHyperscript({\n  ...hyperscriptCreators,\n  elements: { mytag: { type: 'my-type' } },\n})\n// verify before use:\nif (!('mytag' in (jsx.creators ?? {}))) throw new Error('tag not registered')","typeGuard":"const isRegisteredTag = (creators: Record<string, unknown>, tag: string): boolean =>\n  Object.prototype.hasOwnProperty.call(creators, tag)","tryCatchPattern":"null","preventionTips":["Register custom tags via createHyperscript elements/creators","Use a shared hyperscript factory across tests so all tags are registered","Double-check tag spelling against the registered creators"],"tags":["slate","hyperscript","jsx","unknown-tag"],"backgroundTag":"unknown-hyperscript-tag","analyzedSha":"72a37c701e5da4bb13a305d416d9c070d19d3a45","analyzedAt":"2026-08-27T23:04:51.145Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}