prismicio / prismic-gatsby

Gatsby plugins for building websites using Prismic
https://prismic.io/docs/technologies/gatsby
Apache License 2.0
313 stars 97 forks source link

Error: Value is not expected type Image #528

Closed ostaoleho closed 1 year ago

ostaoleho commented 1 year ago

Versions

Steps to reproduce

Update Gatsby to v4 and Prismic to v5 an image with empty data returns null and throws an error.

What is expected?

Preview loads without image error.

What is actually happening?

I have the page templates builded with Prismic. One of content is image that is not required. I made upgrade from gatsby from v3 to v4 and Prismic from v3 to v5 build and site works correct. But when I try visit site with preview mode i have an error Value is not expected type Image.

In Prismic Image field is default

Screenshot 2023-03-01 at 13 02 30

In preview data structure come like this. Thumbnail is object but image is null.

Screenshot 2023-02-28 at 23 03 11

In schema I have this code

Screenshot 2023-03-01 at 13 29 07
jorge-braz commented 1 year ago

I have the same error.

gatsby-source-prismic: ^5.2.10 gatsby: ^5.3.3 node: 18.15.0

angeloashmore commented 1 year ago

This issue may be fixed in a recent version. Please update to the latest version and try again. If the issue continues to be a problem, please open a new issue. Thank you!

See the documentation for guides on updating to the latest versions: Gatsby + Prismic Migration Guides