English 中文(简体)
不能将未界定的(翻新原型)错误的特性与反应通知-x
原标题:Cannot read properties of undefined (reading prototype ) error with react-notion-x

Description

我正试图利用<代码>react-notion-x的图书馆在我的下一个项目上提供数据。 然而,我正在发现一个错误,即“Cannot读到未经界定(翻新原型)的特性”。 这一错误发生在<代码>重读-x的图书馆装满时。

Steps to Reproduce

  1. Install the react-notion-x library in a Next.js project.
  2. Use the NotionRenderer component to render data from a Notion page.
  3. 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"
  }
问题回答

你们是否找到了解决办法?





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签