ueberdosis/tiptap · error

[tiptap warn]: Duplicate widget decoration key "${key}" in e

Error message

[tiptap warn]: Duplicate widget decoration key "${key}" in extension${extensions.size === 1 ? '' : 's'} ${names}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. `comment-${id}`).

What it means

Error "[tiptap warn]: Duplicate widget decoration key "${key}" in extension${extensions.size === 1 ? '' : 's'} ${names}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. `comment-${id}`)." thrown in ueberdosis/tiptap.

Source

Thrown at packages/core/src/decorations/DecorationManager.ts:378

    if (state.widgetKeys.size === 0) {
      this.warnedWidgetKeys.clear()

      return
    }

    const duplicateKeys = findDuplicateWidgetKeys(state.mergedDecorationSet)
    const nextWarningKeys = new Set(duplicateKeys.map(({ key }) => key))

    for (const { key, extensions } of duplicateKeys) {
      if (this.warnedWidgetKeys.has(key)) {
        continue
      }

      const names = Array.from(extensions)
        .map(name => `"${name}"`)
        .join(', ')

      console.warn(
        `[tiptap warn]: Duplicate widget decoration key "${key}" in extension${
          extensions.size === 1 ? '' : 's'
        } ${names}. Widget decoration keys must be globally unique, otherwise ProseMirror ` +
          'misplaces the widget DOM. Use a stable, unique key (e.g. `comment-${id}`).',
      )
    }

    this.warnedWidgetKeys = nextWarningKeys
  }

  /**
   * Builds the merged DecorationSet during init. Skips the merge for a
   * single extension since its per-extension set is already correct.
   * @param doc The document to build the merged set for.
   * @param decorationSetsByExtension The per-extension decoration sets.
   * @returns The merged decoration set.
   */
  private buildMergedSet(

View on GitHub (pinned to 496d53afd7)

When it happens

Trigger: Thrown at packages/core/src/decorations/DecorationManager.ts:378 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ueberdosis/tiptap@496d53afd7 (2026-08-26). Data as JSON: /api/errors/a8315aa4a10cb785. Report an issue: GitHub.