Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Notion API breakage #560

Open
Hades32 opened this issue Aug 29, 2024 · 1 comment
Open

Potential Notion API breakage #560

Hades32 opened this issue Aug 29, 2024 · 1 comment

Comments

@Hades32
Copy link

Hades32 commented Aug 29, 2024

Description

Thanks for this package, it has worked great so far. But since Yesterday (we didn't run the build a few days before that, so maybe earlier) we get this error

Error occurred prerendering page "/blog". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of undefined (reading 'a741637a-07bc-47d5-9114-ffffffffffa5')
    at B (file:///myCodeWebsite/node_modules/notion-utils/build/index.js:1:1602)
    at file:///myCodeWebsite/node_modules/notion-utils/build/index.js:1:7307
    at Array.flatMap (<anonymous>)
    at Ye (file:///myCodeWebsite/node_modules/notion-utils/build/index.js:1:6637)
    at getPreviewImageMap (myCodeWebsite\.next\server\chunks\9077.js:302:80)
    at Object.getCollectionData (myCodeWebsite\.next\server\chunks\9077.js:241:115)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getStaticProps (myCodeWebsite\.next\server\pages\blog.js:303:25)
    at async renderToHTML (myCodeWebsite\node_modules\next\dist\server\render.js:385:20)
    at async myCodeWebsite\node_modules\next\dist\export\worker.js:286:36
export const getStaticProps = async () => {
  const notionPosts = await notion.getCollectionData({
    collectionId: blogCollectionId,
    viewId: blogViewId,
  });

  return {
    props: {
      notionPosts,
    },
    revalidate: 10,
  };
};

Notion Test Page ID

todo

@cajakil
Copy link

cajakil commented Oct 5, 2024

This is probably too late a response, but are you able to check what page a741637a-07bc-47d5-9114-ffffffffffa5 is?

You could try going to notion.so/a741637a07bc47d59114ffffffffffa5 in your browser. (I've taken the dashes out as that sometimes seems to cause errors)

I got a similar error and it was because there were pages in the Trash that react-notion-x was trying to render.

This is fixed by pull request #514. You could try merging it manually into your repo if possible.

Edit: this pull request fixes it for me when running in the dev environment but I still get fatal errors related to trashed pages when building.
#514 is now merged into the master branch - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants