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

[Bug]: TypeError: Cannot read properties of undefined (reading 'isDestroyed') #5881

Closed
1 task done
ownerdelmee opened this issue Nov 27, 2024 · 5 comments
Closed
1 task done
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@ownerdelmee
Copy link

Affected Packages

core

Version(s)

2.10.3

Bug Description

this issue occurs when blocknote and tiptap is launched with typescript and nextjs it seems to be a problem of tiptap/core reading a value of undefined. the call stack points that the error occured at tiptap/core. here is the error : Unhandled Runtime Error

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

Call Stack
_e.createNodeViews
node_modules/@tiptap/core/dist/index.js (4548:1)
eval
node_modules/@blocknote/react/dist/blocknote-react.js (2517:1)

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

the editor to work perfectly fine.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@ownerdelmee ownerdelmee added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Nov 27, 2024
@nperez0111
Copy link
Contributor

Would be ideal to have at least a stack trace to know where the issue is

@ownerdelmee
Copy link
Author

ownerdelmee commented Nov 28, 2024

Oops! Here's the stack trace for reference:

  • _e.createNodeViews at node_modules/@tiptap/core/dist/index.js (line 4548)

  • eval at node_modules/@blocknote/react/dist/blocknote-react.js (line 2517)"

Let me know if there's anything else you'd like help with! 😊.

@ownerdelmee
Copy link
Author

Hey, I think I’ve figured out the root cause! It looks like either Next.js or Tiptap gets a bit confused when there’s a useEffect with no dependencies. Since that makes it run after the component is mounted (onMount), it doesn’t append a value to isDestroyed, which ends up causing this error.

Just wanted to share this insight, and thank you so much for your time and effort—it’s really appreciated! 😊

@nperez0111
Copy link
Contributor

Wait so what was the resolution here? Is there anything in the lib we need to change?

@NicHaley
Copy link

NicHaley commented Dec 1, 2024

I am running into this currently, @ownerdelmee curious what the follow up is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

3 participants