Description
我正试图利用<代码>react-notion-x的图书馆在我的下一个项目上提供数据。 然而,我正在发现一个错误,即“Cannot读到未经界定(翻新原型)的特性”。 这一错误发生在<代码>重读-x的图书馆装满时。
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
<代码>Noenderer部分应使Notion page的数据没有任何错误。
Actual Behavior
<代码>react-notion-x的图书馆装上:
Unhandled Runtime Error
Error: Cannot read properties of undefined (reading prototype )
Notion Test Page ID
i got from the documentation
067dd719a912471ea9a3ac10710e7fdf
Screenshots
Additional Information
我已尝试重新安装<代码>react-notion-x的图书馆并更新至最新版本,但这一错误仍然存在。 我还核实,我正在为<代码>NotionRenderer构成部分提供所有必要的推进剂,数据结构是正确的。
这是使用的法典一。
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>
</>
)
}
这些是所用的工具
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@jridgewell/sourcemap-codec": "^1.4.15",
"@notionhq/client": "^2.2.13",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tooltip": "^1.0.7",
"aos": "^2.3.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cmdk": "^0.2.0",
"framer-motion": "^10.16.4",
"lucide-react": "^0.279.0",
"next": "^13.5.4",
"next-themes": "^0.2.1",
"nextjs-toploader": "^1.4.2",
"node-fetch": "^3.3.2",
"notion-client": "^6.16.0",
"react": "latest",
"react-dom": "latest",
"react-icons": "^4.11.0",
"react-notion-x": "^6.15.6",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^2.9.1",
"zustand": "^4.4.1"
},
"devDependencies": {
"autoprefixer": "latest",
"eslint": "latest",
"eslint-config-next": "latest",
"postcss": "latest",
"tailwindcss": "latest"
}