{"record":{"id":"f8389ae4d1711fbb","repo":"ueberdosis/tiptap","slug":"uniqueid-extension-not-found-in-the-extensions-arr","errorCode":null,"errorMessage":"UniqueID extension not found in the extensions array","messagePattern":"UniqueID extension not found in the extensions array","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/extension-unique-id/src/generate-unique-ids.ts","lineNumber":49,"sourceCode":" * // Result:\n * // {\n * //   type: 'doc',\n * //   content: [\n * //     { type: 'paragraph', content: [{ type: 'text', text: 'Hello, world!' }], id: '123' }\n * //   ]\n * // }\n *\n * @param doc - A Tiptap JSON document to add unique IDs to.\n * @param extensions - The extensions to use. Must include the `UniqueID` extension.\n * @returns The updated Tiptap JSON document, with the unique IDs added to the nodes.\n */\nexport function generateUniqueIds(doc: JSONContent, extensions: Extensions): JSONContent {\n  // Find the UniqueID extension in the extensions array. If it's not found, throw an error.\n  const uniqueIDExtension = extensions.find(ext => ext.name === 'uniqueID') as\n    | typeof UniqueID\n    | undefined\n  if (!uniqueIDExtension) {\n    throw new Error('UniqueID extension not found in the extensions array')\n  }\n  // Convert the JSON content to a ProseMirror node\n  const schema = getSchema([\n    ...extensions.filter(ext => ext.name !== 'uniqueID'),\n    uniqueIDExtension,\n  ])\n  const { types: configuredTypes, attributeName, generateID } = uniqueIDExtension.options\n  const types =\n    configuredTypes === 'all'\n      ? Object.keys(schema.nodes).filter(type => type !== 'doc' && type !== 'text')\n      : configuredTypes\n  const contentNode = PMNode.fromJSON(schema, doc)\n\n  // Find nodes that don't have a unique ID\n  const nodesWithoutId = findChildren(contentNode, node => {\n    return !node.attrs[attributeName] && types.includes(node.type.name)\n  })\n","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/ueberdosis/tiptap/blob/496d53afd7e4e3c7424b4749adeff4f45e27ddb0/packages/extension-unique-id/src/generate-unique-ids.ts#L31-L67","documentation":"Error \"UniqueID extension not found in the extensions array\" thrown in ueberdosis/tiptap.","triggerScenarios":"Thrown at packages/extension-unique-id/src/generate-unique-ids.ts:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"496d53afd7e4e3c7424b4749adeff4f45e27ddb0","analyzedAt":"2026-08-26T22:41:43.400Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}