-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
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
onEditorReadycallbacks withrequestAnimationFrame(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
viewReadystate
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)
- Framework: Next.js 15.5.7 (App Router, Turbopack)
- React: 19.x
- Setup:
useEditorwithimmediatelyRender: false,EditorContentrendered in the same component, Pages configured withpageFormat: 'A4' - Related issues: [Bug]: Editor is not actually read when onCreate is called #5237 (editor not ready when onCreate is called), [Bug]: React Node Views are not rendered on the initial render, causing layout shift #5166 (React node views not rendered on initial render)
- This is specific to the Pages pro extension — removing
Pagesfrom the extensions array eliminates the error entirely
Dependency Updates
- Yes, I've updated all my dependencies.