railwayapp / blog

79 stars 29 forks source link

Getting build error "Cannot read properties of undefined (reading 'rich_text')" #15

Closed codepar closed 2 years ago

codepar commented 2 years ago

Hi team, getting the following build error:

Cannot read properties of undefined (reading 'rich_text'). seem to have to do with the slug (which I have set up as "text" inside Notion as per the tutorial.


TypeError: Cannot read properties of undefined (reading 'rich_text')
at /app/.next/server/chunks/490.js:32:91
at Array.filter (<anonymous>)
at getDatabase (/app/.next/server/chunks/490.js:32:20)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async getStaticPaths (/app/.next/server/pages/p/[slug].js:515:19)
 at async buildStaticPaths (/app/node_modules/next/dist/build/utils.js:497:31)
at async /app/node_modules/next/dist/build/utils.js:640:119
at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:75:20) {
type: 'TypeError'
}
error Command failed with exit code 1.
PrathameshRR commented 1 year ago

Could you share if you were able to resolve this issue? If Yes, could you also share how you did it?

Getting exactly this error

nalenb commented 1 year ago

This is because you are missing the "Description" field. It's required to be a column in the database, but the documentation doesn't mention it.

markojak commented 1 year ago

I'm getting a TypeError: Cannot read properties of undefined (reading 'title') And I'm assuming the title is the page name

Problematic coded is in lib/notion/index.ts r.properties.Page.title.length > 0 &&

It seems that it's not reading the Page.Title from the page but it is defined as "TitlePropertyValue" in types.ts