{"record":{"id":"08e0a30222bb9eac","repo":"codex-team/editor.js","slug":"conversion-from-blocktoconvert-name-to-new","errorCode":null,"errorMessage":"Conversion from \"${blockToConvert.name}\" to \"${newType}\" is not possible. ${unsupportedBlockTypes} tool(s) should provide a \"conversionConfig\"","messagePattern":"Conversion from \"(.+?)\" to \"(.+?)\" is not possible\\. (.+?) tool\\(s\\) should provide a \"conversionConfig\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/components/modules/api/blocks.ts","lineNumber":378,"sourceCode":"\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  };\n\n\n  /**\n   * Inserts several Blocks to a specified index\n   *\n   * @param blocks - blocks data to insert\n   * @param index - index to insert the blocks at\n   */\n  private insertMany = (\n    blocks: OutputBlockData[],\n    index: number = this.Editor.BlockManager.blocks.length - 1\n  ): BlockAPIInterface[] => {\n    this.validateIndex(index);\n\n    const blocksToInsert = blocks.map(({ id, type, data }) => {\n      return this.Editor.BlockManager.composeBlock({","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/codex-team/editor.js/blob/5f45dabbe5690b7033b2f9047d3985add5045fdd/src/components/modules/api/blocks.ts#L360-L396","documentation":"Block conversion uses each tool's conversionConfig (export/import). If the source tool lacks `export` or the target tool lacks `import`, the conversion pipeline cannot run and this error names the offending tool(s).","triggerScenarios":"Calling blocks.convert(id, 'toolX') where either the current block's tool or 'toolX' does not define conversionConfig.export/import; converting from/to the paragraph tool without a custom conversion config where required.","commonSituations":"Third-party tools that never implemented conversionConfig; assuming every tool is convertible; converting between two custom tools where only one side defines export/import.","solutions":["Add conversionConfig {export, import} to the tool(s) named in the message","Convert to a tool that already supports conversion (e.g. one with a defined conversionConfig)","Skip the conversion in UI when neither side supports it"],"exampleFix":"// before\nclass MyTool {\n  static get conversionConfig() { return; }\n}\n// after\nclass MyTool {\n  static get conversionConfig() {\n    return {\n      export: (data) => data.text,\n      import: (raw) => ({ text: raw }),\n    };\n  }\n}","handlingStrategy":"validation","validationCode":"const canConvert = (from: BlockToolConstructable, to: BlockToolConstructable) => Boolean(from.conversionConfig?.export && to.conversionConfig?.import);","typeGuard":"const supportsConversion = (t: unknown): t is { conversionConfig: { export: unknown; import: unknown } } => Boolean((t as any)?.conversionConfig?.export && (t as any)?.conversionConfig?.import);","tryCatchPattern":"try { await editor.blocks.convert(id, newType); } catch (e) { if (e instanceof Error && e.message.includes('conversionConfig')) { /* show unsupported message */ } throw e; }","preventionTips":["Audit tools for conversionConfig before exposing convert UI","Add export/import to custom tools"],"tags":["convert","conversion-config","tool-config","editorjs"],"backgroundTag":"unsupported-operation","analyzedSha":"5f45dabbe5690b7033b2f9047d3985add5045fdd","analyzedAt":"2026-08-27T22:50:23.124Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}