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

React Syntax highlighting - Cannot read property 'nodeType' of null #1520

Closed
minsoois opened this issue Jun 29, 2021 · 6 comments
Closed

React Syntax highlighting - Cannot read property 'nodeType' of null #1520

minsoois opened this issue Jun 29, 2021 · 6 comments
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@minsoois
Copy link

Description
I implemented the vue example in https://www.tiptap.dev/examples/syntax-highlighting in react. However, if you create a code block on a new line, an error occurs.

Steps to reproduce the bug
Steps to reproduce the behavior:

  1. create new line
  2. click the CodeBlock button.
  3. see error message
    image

CodeSandbox
I created a CodeSandbox to help you debug the issue:

Environment?

  • operating system: macOS Big Sur
  • browser: Chrome
  • mobile/desktop: desktop
  • tiptap version: 2.0.0-beta.52

Additional context
If I create a CodeBlock in a new line, an error occurs, and when I create a CodeBlock after dragging the text, no error occurs.

@minsoois minsoois added Type: Bug The issue or pullrequest is related to a bug v2 labels Jun 29, 2021
@hanspagel
Copy link
Contributor

The StarterKit comes with a CodeBlock extension already, disable it like this:

StarterKit({ codeBlock: false })

Does that help?

@minsoois
Copy link
Author

The StarterKit comes with a CodeBlock extension already, disable it like this:

StarterKit({ codeBlock: false })

Does that help?

I tried the above code as is but it failed
image

tried the second time
https://codesandbox.io/s/sleepy-babbage-70mg4

extensions: [
      StarterKit.configure({
        codeBlock: false,
      }),
      ...
]

But the same error occurs.

This time I tried it without StarterKit.
https://codesandbox.io/s/cocky-violet-lp4dx
Still getting the same error.

@hanspagel
Copy link
Contributor

Oh sorry, it’s StarterKit.configure({ codeBlock: false })

@minsoois
Copy link
Author

The StarterKit comes with a CodeBlock extension already, disable it like this:

StarterKit({ codeBlock: false })

Does that help?

I tried the above code as is but it failed
image

tried the second time
https://codesandbox.io/s/sleepy-babbage-70mg4

extensions: [
      StarterKit.configure({
        codeBlock: false,
      }),
      ...
]

But the same error occurs.

This time I tried it without StarterKit.
https://codesandbox.io/s/cocky-violet-lp4dx
Still getting the same error.

@hanspagel

I did that and it didn't work...

If you check the codesandbox link above, I tried doing that, but an error occurs. And I tried it except StarterKit and got the same error.

@hanspagel
Copy link
Contributor

Thanks for the report. That’s definitely an issue, we’ll look into that. Any help is appreciated.

@philippkuehn
Copy link
Contributor

I have to reopen this because this fix caused another issue. I need to find another solution.

@philippkuehn philippkuehn reopened this Jul 30, 2021
andrewlu0 pushed a commit to trybaseplate/tiptap that referenced this issue Oct 20, 2023
…, fix ueberdosis#1608, fix ueberdosis#1520

* remove async createNodeViews

* focus asynchronously to fix weird bugs in react
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

3 participants