Skip to content

[Bug]: Pages extension triggers 'editor view is not available' on mount with React useEditor + EditorContent #7574

@andostronaut

Description

@andostronaut

Affected Packages

@tiptap-pro/extension-pages (1.0.0-alpha.16.2), @tiptap/react (^3.13.0), @tiptap/core (^3.13.0)

Version(s)

@tiptap-pro/extension-pages 1.0.0-alpha.16.2 / @tiptap/react ^3.13.0

Bug Description

When using the Pages extension with useEditor + EditorContent in React (Next.js 15 App Router with Turbopack), we consistently get:

[tiptap error]: The editor view is not available. Cannot access view['dom']. The editor may not be mounted yet.

Root cause: The useEditor hook creates the editor instance and fires onCreate before EditorContent mounts and attaches the ProseMirror view to the DOM. Any extension (or consumer code) that accesses editor.view, editor.getHTML(), editor.getText(), or editor.isActive() during or shortly after onCreate will hit this error because view.dom does not exist yet.

The Pages extension appears to access the view during its initialization phase, which triggers the error before EditorContent has had a chance to mount.

Workarounds we've tried (none fully resolve the timing issue from the extension itself):

  • Setting immediatelyRender: false — reduces frequency but doesn't eliminate it
  • Deferring onEditorReady callbacks with requestAnimationFrame (even 2–3 frames)
  • Wrapping view access in try/catch in our own code
  • Adding an error boundary with retry logic
  • Gating BubbleMenu and Toolbar rendering behind a viewReady state

All of these are workarounds for our code. The error still fires from within the Pages extension's own initialization before we can gate anything.

Browser Used

Chrome (also reproducible in Safari and Firefox)

Expected Behavior

Extensions should not access view.dom during onCreate or initialization, since the React integration does not attach the view until EditorContent mounts. The Pages extension should defer any view-dependent initialization until the view is actually available, or the React integration should guarantee the view exists before onCreate fires.

Additional Context (Optional)

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions