splitbee / react-notion

A fast React renderer for Notion pages
https://react-notion.com
MIT License
2.85k stars 149 forks source link

Uncaught TypeError: can't access property "caption", value.properties is undefined #116

Closed teekaytech closed 9 months ago

teekaytech commented 1 year ago

Hi there,

I'm using the library to render a notion page on my react app.

I used the notion-API-worker to fetch the page, passing in the pageId:

export const getNotionPage = async (pageId: string) => {
  const data = await fetch(
    `https//notion-api.splitbee.io/v1/page/${pageId}`
  ).then((res) => res.json());
  return data;
};

Then in my component, I used the useEffect hook to set the pate state:

  useEffect(() => {
    setLoading(true);
    getNotionPage(PAGE_ID)
      .then((page) => setSupportPage(page))
      .catch((err) =>  console.error(err))
      .finally(() => setLoading(false));
  }, []);

In my console, I keep getting the error:

Screenshot 2023-03-17 at 10 03 16

I'm not sure why this is happening, could it be because I have an empty video block on my notion page?

Thanks in advance.