Skip to content

TypeError: Cannot read properties of undefined (reading 'colIndex') when using table handles in BlockNote #1411

Closed

Description

@TtBJSH

Description

When using BlockNote with table handles enabled, I frequently encounter the following error:
TypeError: Cannot read properties of undefined (reading 'colIndex') at HTMLDivElement.<anonymous>

This error occurs randomly when interacting with tables in the editor.

Environment

  • "@blocknote/react": "^0.22.0"
  • "react": "^18.0.0"
  • Chrome Version: 132.0.6834.160 (Official Build) (64-bit)

Code Example

// Editor component

<BlockNoteView
    editor={editor}
    theme="light"
    onChange={handleChange}
    emojiPicker={false}
    slashMenu={false}
    editable={!readOnly}
    formattingToolbar={false}
    tableHandles={true}
/>

Steps to Reproduce

  1. Create a table in the editor
  2. Enable table handles
  3. Interact with the table (e.g., selecting cells, adding/removing rows/columns)
  4. The error occurs randomly during these interactions

Expected Behavior
Table handles should work smoothly without throwing undefined property errors.

Additional Context

  • The error seems to be related to the table handles feature
  • It occurs intermittently and is hard to reproduce consistently
  • The editor still functions but the error appears in the console

Would appreciate any help in resolving this issue or guidance on proper configuration of table handles.

Activity

  1. dikaioai commented on Feb 3, 2025

    @dikaioai

    same error when deleting the last cell of a table

    "@blocknote/react": "^0.22.0"
    "react": "^19.0.0"
    Chrome Version: 132.0.6834.160 (Official Build) (64-bit)

    Also we got this:

    TypeError: Cannot read properties of undefined (reading 'getBoundingClientRect')
        at ea.update (https://dikaio.localdev:3000/_next/static/chunks/59a4e_%40blocknote_core_dist_blocknote_9fc2ed.js:10185:45)
        at EditorView.updatePluginViews (https://dikaio.localdev:3000/_next/static/chunks/a2f35_prosemirror-view_dist_index_e647c2.js:4900:51)
        at EditorView.updateStateInner (https://dikaio.localdev:3000/_next/static/chunks/a2f35_prosemirror-view_dist_index_e647c2.js:4859:14)
        at EditorView.updateState (https://dikaio.localdev:3000/_next/static/chunks/a2f35_prosemirror-view_dist_index_e647c2.js:4795:14)
        at ye.dispatchTransaction (https://dikaio.localdev:3000/_next/static/chunks/1205e_%40tiptap_core_dist_index_57da49.js:4561:19)
        at EditorView.dispatch (https://dikaio.localdev:3000/_next/static/chunks/a2f35_prosemirror-view_dist_index_e647c2.js:5098:54)
        at Object.method [as command] (https://dikaio.localdev:3000/_next/static/chunks/1205e_%40tiptap_core_dist_index_57da49.js:177:26)
        at gn (https://dikaio.localdev:3000/_next/static/chunks/59a4e_%40blocknote_core_dist_blocknote_9fc2ed.js:7523:16)
        at co.updateBlock (https://dikaio.localdev:3000/_next/static/chunks/59a4e_%40blocknote_core_dist_blocknote_9fc2ed.js:11044:16)
        at onClick (https://dikaio.localdev:3000/_next/static/chunks/ff866_%40blocknote_react_dist_blocknote-react_fa7240.js:2759:15)
        at handleEvent (https://dikaio.localdev:3000/_next/static/chunks/08b5e__pnpm_9e799f._.js:47968:31)
        at processDispatchQueue (https://dikaio.localdev:3000/_next/static/chunks/d6168_next_dist_compiled_react-dom_612766._.js:8501:25)
        at https://dikaio.localdev:3000/_next/static/chunks/d6168_next_dist_compiled_react-dom_612766._.js:8798:13
        at batchedUpdates$1 (https://dikaio.localdev:3000/_next/static/chunks/d6168_next_dist_compiled_react-dom_612766._.js:2090:44)
        at dispatchEventForPluginEventSystem (https://dikaio.localdev:3000/_next/static/chunks/d6168_next_dist_compiled_react-dom_612766._.js:8583:9)
        at dispatchEvent (https://dikaio.localdev:3000/_next/static/chunks/d6168_next_dist_compiled_react-dom_612766._.js:10685:37)
        at dispatchDiscreteEvent (https://dikaio.localdev:3000/_next/static/chunks/d6168_next_dist_compiled_react-dom_612766._.js:10667:64)
    
  2. self-assigned this
    on Feb 17, 2025
  3. YousefED commented on Feb 24, 2025

    @YousefED
    Collaborator

    @nperez0111 do you think #1446 will address this?

  4. nperez0111 commented on Feb 24, 2025

    @nperez0111
    Contributor

    Hard to say without a full reproduction, but I did partially rewrite the table handle behavior, so I think it should address this.

  5. YousefED commented on Jun 19, 2025

    @YousefED
    Collaborator

    Closing this as a lot of related code has changed. Please open a new issue with reproducible example if it still occurs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions