ricokahler / sanity-codegen

Generate TypeScript types from your Sanity.io schemas
sanity-codegen-dev.vercel.app
MIT License
270 stars 19 forks source link

`TypeError: Cannot convert object to primitive value` error for `rich-date-input` sanity plugin while running sanity-codegen #262

Open rebisha opened 2 years ago

rebisha commented 2 years ago

I'm using @sanity/rich-date-input plugin in my project, and I've followed the docs properly for adding the plugin to the project. However, when I run sanity-codegen script, I get TypeError: Cannot convert object to primitive value error. Is there a way for me to either exclude richDate type generation while running sanity-codegen or just make it work by not throwing any error while running sanity-codegen script?

Any help will be greatly appreciated.

Thanks!

Screenshot of the error: Screen Shot 2022-03-28 at 3 21 52 pm !

How I'm using richDate in my schema: { title: "Date & Time", description: "When do you want to start/end the timer", name: "timer", type: "richDate", options: { inputDate: true, inputTime: true, dateFormat: 'YY-MM-DD z', timeFormat: 'hh:mm a', timeStep: 15, }, validation: Rule => Rule.required(), },