Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TtBJSH opened this issue Feb 3, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@TtBJSH
Copy link

TtBJSH commented Feb 3, 2025

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.

@TtBJSH TtBJSH added the bug Something isn't working label Feb 3, 2025
@dikaioai
Copy link

dikaioai commented Feb 3, 2025

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)

@YousefED YousefED self-assigned this Feb 17, 2025
@YousefED
Copy link
Collaborator

@nperez0111 do you think #1446 will address this?

@YousefED YousefED assigned nperez0111 and unassigned YousefED Feb 24, 2025
@nperez0111
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants