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

tiptap HocuspocusProvider error in editing Unexpected end of array #863

Open
Mrezagolbaba opened this issue Oct 14, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@Mrezagolbaba
Copy link

Description
I tried to generate live collaboration with Tiptap and HocuspocusProvider in Reactjs the web socket is working well but when I want to start editing I see a weird error that is stopping me from editing the document

Steps to reproduce the bug
by starting editing we will see the attached image

Expected behavior
A clear and concise description of what you expected to happen.

Screenshot, video, or GIF
image

Environment?

  • operating system:OSX
  • browser:Chroume
  • mobile/desktop:Desktop
  • Hocuspocus version:^2.13.7

Additional context

const provider = new HocuspocusProvider({
    url: "ws://localhost:8000/ws/document/edit/3f798b14-4635-4450-bc66-b05b04fbfb8f?token=" + TEST_TOKEN,
    name: "3f798b14-4635-4450-bc66-b05b04fbfb8f",
    document: ydoc,
});

function Tiptap({
    content = '',
    editable = true,
    placeholder = "Type '/' for actions…",
}: TiptapProps) {
    const extensions: Extensions = [
        Collaboration.configure({
            document: provider.document,
        }),
        CollaborationCursor.configure({
            provider: provider,
            user: {
              name: 'Cyndi Lauper',
              color: '#f783ac',
            },
          }),
    ]
    const editor = useEditor({
        content,
        extensions,
        editable,
        onUpdate: ({ editor }) => {
            console.log(editor.getJSON())
        },
    })

    if (!editor) {
        return null
    }

    return (
      
            <div className="WhiteCard">
                <EditorContent editor={editor} />
            </div>
    )
}

export default Tiptap


@Mrezagolbaba Mrezagolbaba added the bug Something isn't working label Oct 14, 2024
@vinceprofeta
Copy link

@Mrezagolbaba Any luck here?

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

3 participants