{"record":{"id":"3ce2ff7ab9419d6f","repo":"ueberdosis/tiptap","slug":"tiptap-table-of-contents-deprecation-notice-the","errorCode":null,"errorMessage":"[Tiptap Table of Contents Deprecation Notice]: The 'scrollParent' option must now be provided as a callback function that returns the 'scrollParent' element. The ability to pass this option directly will be deprecated in future releases.","messagePattern":"\\[Tiptap Table of Contents Deprecation Notice\\]: The 'scrollParent' option must now be provided as a callback function that returns the 'scrollParent' element\\. The ability to pass this option directly will be deprecated in future releases\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/extension-table-of-contents/src/tableOfContents.ts","lineNumber":270,"sourceCode":"        onUpdate: this.options.onUpdate?.bind(this),\n        getIndexFn: this.options.getIndex || getLinearIndexes,\n        getLevelFn: this.options.getLevel || getHeadlineLevel,\n        anchorTypes: this.options.anchorTypes,\n      })\n    }\n  },\n\n  onCreate() {\n    // Avoid mutating the document during server-side rendering.\n    if (typeof window === 'undefined' || !this.editor.view) {\n      return\n    }\n\n    const { tr } = this.editor.state\n    const existingIds: string[] = []\n\n    if (this.options.scrollParent && typeof this.options.scrollParent !== 'function') {\n      console.warn(\n        \"[Tiptap Table of Contents Deprecation Notice]: The 'scrollParent' option must now be provided as a callback function that returns the 'scrollParent' element. The ability to pass this option directly will be deprecated in future releases.\",\n      )\n    }\n\n    this.editor.state.doc.descendants((node, pos) => {\n      const nodeId = node.attrs['data-toc-id']\n      const isValidType = this.options.anchorTypes?.includes(node.type.name)\n\n      if (!isValidType || node.textContent.length === 0) {\n        return\n      }\n\n      if (nodeId === null || nodeId === undefined || existingIds.includes(nodeId)) {\n        let id = ''\n\n        if (this.options.getId) {\n          id = this.options.getId(node.textContent)\n        } else {","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/ueberdosis/tiptap/blob/496d53afd7e4e3c7424b4749adeff4f45e27ddb0/packages/extension-table-of-contents/src/tableOfContents.ts#L252-L288","documentation":"Error \"[Tiptap Table of Contents Deprecation Notice]: The 'scrollParent' option must now be provided as a callback function that returns the 'scrollParent' element. The ability to pass this option directly will be deprecated in future releases.\" thrown in ueberdosis/tiptap.","triggerScenarios":"Thrown at packages/extension-table-of-contents/src/tableOfContents.ts:270 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"}