{"record":{"id":"8036468605ca70d2","repo":"codex-team/editor.js","slug":"block-tool-with-type-newtype-not-found","errorCode":null,"errorMessage":"Block Tool with type \"${newType}\" not found","messagePattern":"Block Tool with type \"(.+?)\" not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/components/modules/api/blocks.ts","lineNumber":362,"sourceCode":"   *\n   * @param id - id of the existing block to convert. Should provide 'conversionConfig.export' method\n   * @param newType - new block type. Should provide 'conversionConfig.import' method\n   * @param dataOverrides - optional data overrides for the new block\n   * @throws Error if conversion is not possible\n   */\n  private convert = async (id: string, newType: string, dataOverrides?: BlockToolData): Promise<BlockAPIInterface> => {\n    const { BlockManager, Tools } = this.Editor;\n    const blockToConvert = BlockManager.getBlockById(id);\n\n    if (!blockToConvert) {\n      throw new Error(`Block with id \"${id}\" not found`);\n    }\n\n    const originalBlockTool = Tools.blockTools.get(blockToConvert.name);\n    const targetBlockTool = Tools.blockTools.get(newType);\n\n    if (!targetBlockTool) {\n      throw new Error(`Block Tool with type \"${newType}\" not found`);\n    }\n\n    const originalBlockConvertable = originalBlockTool?.conversionConfig?.export !== undefined;\n    const targetBlockConvertable = targetBlockTool.conversionConfig?.import !== undefined;\n\n    if (originalBlockConvertable && targetBlockConvertable) {\n      const newBlock = await BlockManager.convert(blockToConvert, newType, dataOverrides);\n\n      return new BlockAPI(newBlock);\n    } else {\n      const unsupportedBlockTypes = [\n        !originalBlockConvertable ? capitalize(blockToConvert.name) : false,\n        !targetBlockConvertable ? capitalize(newType) : false,\n      ].filter(Boolean).join(' and ');\n\n      throw new Error(`Conversion from \"${blockToConvert.name}\" to \"${newType}\" is not possible. ${unsupportedBlockTypes} tool(s) should provide a \"conversionConfig\"`);\n    }\n  };","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/codex-team/editor.js/blob/5f45dabbe5690b7033b2f9047d3985add5045fdd/src/components/modules/api/blocks.ts#L344-L380","documentation":"During blocks.convert(id, newType) the target tool name is looked up in Tools.blockTools; an unregistered tool name throws this error. Only tools registered in editor config (or internal tools) can be conversion targets.","triggerScenarios":"Calling editor.blocks.convert(id, 'myTool') when 'myTool' was never passed in the tools config; misspelling a tool name; using a tool name that is an inline or block tune rather than a block tool.","commonSituations":"Copying example code that converts to a tool not installed; tool name casing mismatch ('Header' vs 'header'); tool registered lazily after the convert call.","solutions":["Register the target tool in the Editor.js tools config before calling convert","Verify the exact tool name via Object.keys of your tools config / editor.tools","Use the canonical internal name (e.g. 'paragraph', 'header') matching your config key"],"exampleFix":"// before\nEditorJS.create({ tools: { paragraph: Paragraph }, ... });\neditor.blocks.convert(id, 'header');\n// after\nEditorJS.create({ tools: { paragraph: Paragraph, header: Header }, ... });\neditor.blocks.convert(id, 'header');","handlingStrategy":"validation","validationCode":"const known = new Set(Object.keys(toolsConfig)); if (!known.has(newType)) throw new Error(`tool ${newType} not registered`); await editor.blocks.convert(id, newType);","typeGuard":"const isRegisteredTool = (name: string, cfg: Record<string, unknown>): name is string => name in cfg;","tryCatchPattern":"try { await editor.blocks.convert(id, newType); } catch (e) { if (e instanceof Error && e.message.includes('Tool with type')) { /* register tool then retry */ } throw e; }","preventionTips":["Keep a single source of truth for tool names","Mirror editor config keys exactly when converting"],"tags":["convert","tool-registry","not-found","editorjs"],"backgroundTag":"entity-not-found","analyzedSha":"5f45dabbe5690b7033b2f9047d3985add5045fdd","analyzedAt":"2026-08-27T22:50:23.124Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}