splitbee/react-notion

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

teekaytech opened this issue · 0 comments

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.