ueberdosis/tiptap · error

[tiptap warn]: `editor.state` was read while decoration `cre

Error message

[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.

What it means

Error "[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor." thrown in ueberdosis/tiptap.

Source

Thrown at packages/core/src/Editor.ts:382

          // We throw an error here, because we know the view is not available
          throw new Error(
            `[tiptap error]: The editor view is not available. Cannot access view['${key as string}']. The editor may not be mounted yet.`,
          )
        },
      },
    ) as EditorView
  }

  /**
   * Returns the editor state.
   */
  public get state(): EditorState {
    if (isDev && !this.hasWarnedStaleDecorationRead && isInDecorationApplyScope(this)) {
      // Warn once per editor. The same read repeats on every transaction, and
      // a decoration that dispatches from `create()` would flood the console.
      this.hasWarnedStaleDecorationRead = true

      console.warn(
        '[tiptap warn]: `editor.state` was read while decoration `create()` was running. ' +
          'It returns the pre-transaction document. Use the `state` argument passed to ' +
          '`create()` instead. Helpers like `editor.isActive()` read `editor.state` too, ' +
          'so pass `state` to their standalone versions instead of calling them on the editor.',
      )
    }

    if (this.editorView) {
      this.editorState = this.view.state
    }

    return this.editorState
  }

  /**
   * Register a ProseMirror plugin.
   *
   * @param plugin A ProseMirror plugin

View on GitHub (pinned to 496d53afd7)

When it happens

Trigger: Thrown at packages/core/src/Editor.ts:382 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/03c9b3f68f1c1424. Report an issue: GitHub.