Skip to content

Cannot access view['dom']. (also occurs in official example) #2189

@1rrock

Description

@1rrock

Describe the bug
When using FormattingToolbar as a child inside (while also setting formattingToolbar={false}), the editor throws an error on unmount.
It seems CreateLinkButton.ts:76 tries to access editor.prosemirrorView.dom, but the editor view is already unavailable.

Actual error:

error-boundary-callbacks.ts:106 Uncaught Error: [tiptap error]: The editor view is not available. Cannot access view['dom']. The editor may not be mounted yet.
at Object.get (Editor.ts:335:17)

To Reproduce
Use the component like this:

<BlockNoteView
  editor={editor}
  theme="light"
  slashMenu={false}
  formattingToolbar={false}
>
  <FormattingToolbar />
</BlockNoteView>

On unmount, it triggers the error due to editor.prosemirrorView.dom being undefined.

Expected behavior
Unmounting should not attempt to access editor.prosemirrorView.dom when the editor is already gone.

Misc

Node version: 24.4.1

Package manager: npm 11.4.2

BlockNote version: 0.41.1

Framework: Next.js

Browser: (your browser here)

I'm a sponsor and would appreciate a quicker review 💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions