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

table block not working #40

Open
ZanMarolt opened this issue Sep 3, 2022 · 1 comment
Open

table block not working #40

ZanMarolt opened this issue Sep 3, 2022 · 1 comment

Comments

@ZanMarolt
Copy link

ZanMarolt commented Sep 3, 2022

Hello, thanks for maintaining this tool. 🙏

I am trying to create a basic table, but am unable to do so. My table looks like this:

| Date       | Exercise      |
|------------|---------------|
| 27.08.2022 | exercise 0    |
| 30.08.2022 | exercise 1    |
| 01.09.2022 | exercise 2    |
| 02.09.2022 | exercise 3    |

However the request fails with:

@notionhq/client warn: request fail {
  code: 'validation_error',
  message: 'body failed validation: body.children[21].table.table-width should be not present, instead was `5`.'
}
/**Path**/node_modules/@notionhq/client/build/src/errors.js:162
        return new APIResponseError({
               ^

APIResponseError: body failed validation: body.children[21].table.table-width should be not present, instead was `5`.

I am using markdownToBlocks function with package versions:

    "@notionhq/client": "2.2.0",
    "@tryfabric/martian": "1.2.4",

Anyone else facing similar issue?

@InsightForesight
Copy link

trouble with table:

{
  "object": "block",
  "type": "table",
  "table": {
    "table_width": 3,
    "has_column_header": true,
    "children": [
      {
        "object": "block",
        "type": "table_row",
        "table_row": {
          "cells": [
            [
              {
                "type": "text",
                "annotations": {
                  "bold": false,
                  "strikethrough": false,
                  "underline": false,
                  "italic": false,
                  "code": false,
                  "color": "default"
                },
                "text": { "content": "CFG scale" }
              }
            ],
            [
              {
                "type": "text",
                "annotations": {
                  "bold": false,
                  "strikethrough": false,
                  "underline": false,
                  "italic": false,
                  "code": false,
                  "color": "default"
                },
                "text": { "content": "8" }
              }
            ],
            [
              {
                "type": "text",
                "annotations": {
                  "bold": false,
                  "strikethrough": false,
                  "underline": false,
                  "italic": false,
                  "code": false,
                  "color": "default"
                },
                "text": {
                  "content": "test"
                }
              }
            ]
          ]
        }
      }
    ]
  }
}

body failed validation. Fix one:
body.children[0].paragraph.children[0].embed should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].bookmark should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].image should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].video should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].pdf should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].file should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].audio should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].code should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].equation should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].divider should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].breadcrumb should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].table_of_contents should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].link_to_page should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].table_row should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].heading_1 should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].heading_2 should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].heading_3 should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].paragraph should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].bulleted_list_item should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].numbered_list_item should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].quote should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].to_do should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].toggle should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].template should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].callout should be defined, instead was `undefined`.
body.children[0].paragraph.children[0].synced_block should be defined, instead was `undefined`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants