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

Convex + BlockNote fails with initialContent #1348

Open
BleedingDev opened this issue Jan 1, 2025 · 0 comments
Open

Convex + BlockNote fails with initialContent #1348

BleedingDev opened this issue Jan 1, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@BleedingDev
Copy link

BleedingDev commented Jan 1, 2025

Describe the bug
Convex component for TipTap works for sync, but fails with loading initialContent.

Error

Error: initialContent must be a non-empty array of blocks, received: [object Object]
    at EditorContent (editor.tsx:40:18)
console.error	@	suppress-nextjs-warning.ts:15

Initial Content

{
    "type": "doc",
    "content": [
        {
            "type": "blockGroup",
            "content": [
                {
                    "type": "blockContainer",
                    "attrs": {
                        "id": "ae03b85c-f1df-45d8-821f-d6d5e175d7b6",
                        "textColor": "default",
                        "backgroundColor": "default"
                    },
                    "content": [
                        {
                            "type": "paragraph",
                            "attrs": {
                                "textAlignment": "left"
                            },
                            "content": [
                                {
                                    "type": "text",
                                    "text": "Tak co, budeme syncovat?"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "blockContainer",
                    "attrs": {
                        "id": "fc4451aa-46cf-485e-b442-caa5d3d8894e",
                        "textColor": "default",
                        "backgroundColor": "default"
                    },
                    "content": [
                        {
                            "type": "heading",
                            "attrs": {
                                "textAlignment": "left",
                                "level": 1
                            },
                            "content": [
                                {
                                    "type": "text",
                                    "text": "Ale jak..."
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "blockContainer",
                    "attrs": {
                        "id": "5b6e4de4-be00-4f27-997e-1580014dc069",
                        "textColor": "default",
                        "backgroundColor": "default"
                    },
                    "content": [
                        {
                            "type": "paragraph",
                            "attrs": {
                                "textAlignment": "left"
                            },
                            "content": [
                                {
                                    "type": "text",
                                    "text": "naplníme původní obsah, když to nefunguje? 😭 "
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "blockContainer",
                    "attrs": {
                        "id": "8e7bbeea-c660-40a3-8593-cdecfb01df07",
                        "textColor": "default",
                        "backgroundColor": "default"
                    },
                    "content": [
                        {
                            "type": "paragraph",
                            "attrs": {
                                "textAlignment": "left"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

To Reproduce

  1. Basic template for BlockNote.
  2. Add Convex ProseMirror component to _extensions.
  3. Add initialContent and observe broken app.

Expected outcome

Sync and initial content works well.

Current outcome

Sync works for the first time, but after page refresh it fails to load initialContent with error above.

Videos

No initialContent

Zaznam.obrazovky.2025-01-01.204540.mp4

Provided initialContent

Zaznam.obrazovky.2025-01-01.204842.mp4

Misc

  • Node version: v22
  • Package manager: pnpm
  • Browser: Chrome or Edge
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

1 participant