transitive-bullshit / nextjs-notion-starter-kit

Deploy your own Notion-powered website in minutes with Next.js and Vercel.
https://transitivebullsh.it/nextjs-notion-starter-kit
MIT License
6.21k stars 5.25k forks source link

TypeError: Cannot read property 'blockIds' of undefined #238

Closed yangyangisyou closed 2 years ago

yangyangisyou commented 2 years ago

I use this issue then downloaded and built this project is looks OK and run on my local, but today, when I build this project then I got this error:

> Build error occurred
Error: Export encountered errors on following paths:
        /
        /image-charts
        /saas-maker-api-competitive-landscape
        /transitivebullshit

And those page logs are below:

20:07:15.010    TypeError: Cannot read property 'blockIds' of undefined
...
20:07:24.707    Error occurred prerendering page "/transitivebullshit". Read more: https://nextjs.org/docs/messages/prerender-error
20:07:24.707    TypeError: Cannot read property 'blockIds' of undefined
20:07:33.475    "alias" missing block bc10c1eb-02ae-4f7e-8851-77db3785b7f4
20:07:33.611    "alias" missing block 51d66f68-d014-46bf-85c5-456a7633ce4d
20:07:35.741    Error occurred prerendering page "/saas-maker-api-competitive-landscape". Read more: https://nextjs.org/docs/messages/prerender-error
20:07:35.741    TypeError: Cannot read property 'blockIds' of undefined
20:07:36.378    "alias" missing block 8b030ee7-ab27-434d-9fd9-d0562882c17c
20:07:38.618    Error occurred prerendering page "/image-charts". Read more: https://nextjs.org/docs/messages/prerender-error
20:07:38.618    TypeError: Cannot read property 'blockIds' of undefined

page load error {
  pageId: '8ef6901b-4ec7-48b9-829b-8a335ed78858',
  spaceId: 'fde5ac74-eea3-4527-8f00-4482710e1af3'
} undefined Response code 502 (Bad Gateway)

I have no idea with blockIds, because I add pipeline to:

const blockIds = (Object.keys(recordMap.block) || [])

But It seems like not working to this error.

transitive-bullshit commented 2 years ago

Thanks for the report @yangyangisyou.

I'm currently fixing some issues with react-notion-x and updating the starter kit.

Expect a fix within a few days.

transitive-bullshit commented 2 years ago

The latest version should fix your issue.

If it doesn't, let me know.

yangyangisyou commented 2 years ago

Thanks for your quick fix, It works. Nice job.