-
Notifications
You must be signed in to change notification settings - Fork 29
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
Unknown block type "undefined", specify a component for it in the components.types
prop
#22
Comments
What does your schema look like in sanity? |
If you checkout this issue I put an example of typescript usage there. You're not using typescript but it looks to me like your components object is structured wrong. You can also check these docs, I understand they're frustrating at times. |
export default {
name: 'eucharistDates',
title: 'Msze Święte',
type: 'document',
fields: [
{
name: 'dates',
title: 'Dni i godziny mszy świętych',
description: 'np. Sobota: 8:00 9:00 Niedziela 7:00 9:00 10:00',
type: 'array',
of: [{ type: 'block' }],
},
],
}; |
I got a working sandbox as an example for you. It looks like you're passing in the incorrect data to the PortableText component. |
You're right. I passed result array not blocks array. |
Im getting error
Unknown block type "undefined", specify a component for it in the `components.types` prop
when im trying to display data from sanity in<PortableText/>
Data from sanity:
Next.js code:
The text was updated successfully, but these errors were encountered: