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 'nodeType') #1246

Closed
1 task done
mieradi opened this issue Nov 14, 2024 · 5 comments · Fixed by #1341
Closed
1 task done

TypeError: Cannot read properties of undefined (reading 'nodeType') #1246

mieradi opened this issue Nov 14, 2024 · 5 comments · Fixed by #1341
Labels
bug Something isn't working sponsor

Comments

@mieradi
Copy link

mieradi commented Nov 14, 2024

Describe the bug
I have a few instances of BlockNote on my page. One on initial render, and others that come from a side nav when clicked. When I render an image or custom block in the side nav instance and perform a drag, I get the error a type error.

TypeError: Cannot read properties of undefined (reading 'nodeType')

Screen.Recording.2024-11-14.at.7.51.01.AM.mov

To Reproduce
1 - Mount an instance of BockNote on a page
2 - Conditionally mount a second instance of BlockNote
3 - Create a custom block
4 - Render custom block in the conditionally instance of BlockNote
5 - Perform drag on custom block

Misc

  • Node version: v19.0.1
  • Package manager: webpack (nextjs 14.1.4)
  • Browser: Chrome
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖
@mieradi mieradi added the bug Something isn't working label Nov 14, 2024
@YousefED
Copy link
Collaborator

YousefED commented Nov 14, 2024

Thanks for reporting and sponsoring!

We'll aim look into this next week 👍

@mieradi
Copy link
Author

mieradi commented Nov 14, 2024

Thanks for reporting and sponsoring!

We'll aim look into this next week 👍

Thank you kindly!

@mieradi
Copy link
Author

mieradi commented Nov 25, 2024

I've noticed more on this issue - it seems that when there are multiple instances of the editor on the same page, dragging a block will actually move it into another instance of the editor which is causing the issue.

So it seems that the blocks aren't scoped to their parent editor instance.

@mieradi
Copy link
Author

mieradi commented Nov 27, 2024

Here is another error while dragging when clicking the + button to add a new block above a custom block

Screenshot 2024-11-26 at 8 14 36 PM

@mieradi
Copy link
Author

mieradi commented Dec 3, 2024

Has there been any progress on this? I think the issue has been spawning from having multiple instances of an editor on one page

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

Successfully merging a pull request may close this issue.

2 participants