I am trying to render data from Notion using the react-notion-x library in my Next.js project. However, I am getting an error that says "Cannot read properties of undefined (reading 'prototype')". This error occurs when the react-notion-x library is loaded.
Steps to Reproduce
Install the react-notion-x library in a Next.js project.
Use the NotionRenderer component to render data from a Notion page.
Run the project and observe the error that occurs.
Expected Behavior
The NotionRenderer component should render the data from the Notion page without any errors.
Actual Behavior
The following error occurs when the react-notion-x library is loaded:
i got from the documentation
067dd719a912471ea9a3ac10710e7fdf
Screenshots
Additional Information
I have tried reinstalling the react-notion-x library and updating it to the latest version, but the error still occurs. I have also checked that I am providing all the required props to the NotionRenderer component and that the data structure is correct.
this is the code I used
import Container from "@/components/elements/Container"
import PageHeading from "@/components/elements/PageHeading"
import BackButton from "@/components/elements/BackButton"
import { NotionRenderer } from "react-notion-x"
import { NotionAPI } from 'notion-client'
const notion = new NotionAPI()
export default async function ProjectDetailPage({ params }) {
const recordMap = await notion.getPage('067dd719a912471ea9a3ac10710e7fdf')
console.log(recordMap)
return (
<>
<Container>
<BackButton />
<PageHeading title="" />
<NotionRenderer recordMap={recordMap} fullPage={true} darkMode={false} />
</Container>
</>
)
}
Description
I am trying to render data from Notion using the
react-notion-x
library in my Next.js project. However, I am getting an error that says "Cannot read properties of undefined (reading 'prototype')". This error occurs when thereact-notion-x
library is loaded.Steps to Reproduce
react-notion-x
library in a Next.js project.NotionRenderer
component to render data from a Notion page.Expected Behavior
The
NotionRenderer
component should render the data from the Notion page without any errors.Actual Behavior
The following error occurs when the
react-notion-x
library is loaded:Notion Test Page ID
i got from the documentation
067dd719a912471ea9a3ac10710e7fdf
Screenshots
Additional Information
I have tried reinstalling the
react-notion-x
library and updating it to the latest version, but the error still occurs. I have also checked that I am providing all the required props to theNotionRenderer
component and that the data structure is correct.this is the code I used
and these are the depedencies used