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

Field validation failed: content: Unexpected error: Error: 0:paragraph has unexpected children #997

Closed
zanhk opened this issue Mar 10, 2024 · 3 comments

Comments

@zanhk
Copy link

zanhk commented Mar 10, 2024

Getting the error

"Field validation failed: content: Unexpected error: Error: 0:paragraph has unexpected children"

when trying to use a multiline field in a custom component (markdoc)

google_screen_recording_2024-03-10T20-42_44.013Z.webm
ContactWithForm: block({
	label: "Form di contatto",
	icon: ContactIcon({ ariaHidden: true }),
	description: "Personalizza le informazioni relative alla form di contatto",
	schema: {
		title: fields.text({
			label: "Titolo",
			validation: {
				isRequired: true,
			},
		}),
		subtitle: fields.text({
			label: "Sottotitolo",
			validation: {
				isRequired: true,
			},
		}),
		email: fields.text({
			label: "Email",
			validation: {
				isRequired: true,
			},
		}),
		phone: fields.text({
			label: "Telefono",
			validation: {
				isRequired: true,
			},
		}),
		timetables: fields.text({
			label: "Orari",
			multiline: true, // <- here causing the problem
		}),
	},
}),

I would expect something like "test\ntest"

Thanks

@emmatown
Copy link
Member

This is caused by a bug in Markdoc, a fix has been merged but not yet released: markdoc/markdoc#470

@zanhk
Copy link
Author

zanhk commented Mar 12, 2024

I see they released the fix with the version 0.4.0 so Keystatic need to upgrade the markdoc version https://github.com/Thinkmill/keystatic/blob/main/packages/keystatic/package.json#L112, correct?

@emmatown
Copy link
Member

Nice! missed that, will get Keystatic updated

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