[ ] Chore (a non-breaking change which is related to package maintenance)
[x] Bug fix (a non-breaking change which fixes an issue)
[ ] New feature (a non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
This PR adds a non-production error when <PrismicNextImage> does not have an available alt value.
<PrismicNextImage> uses the following priority to determine its alt value:
Its alt prop ("" is the only valid value)
The image field's alt property (set in Prismic)
Its fallbackAlt prop ("" is the only valid value)
The error recommends setting Alternative Text in Prismic along with instructions on marking the image as decorative, if desired.
[PrismicNextImage] The following image is missing an "alt" property. Please add Alternative Text to the image in Prismic. To mark the image as decorative instead, add one of \`alt=""\` or \`fallbackAlt=""\`.
This error message is displayed just before next/image's built-in error which is logged in the same case as the above message. There is no way to disable the next/image error without providing an alt value, so this PR lets both errors log.
Checklist:
[ ] My change requires an update to the official documentation.
[x] All TSDoc comments are up-to-date and new ones have been added where necessary.
Types of changes
Description
This PR adds a non-production error when
<PrismicNextImage>
does not have an availablealt
value.<PrismicNextImage>
uses the following priority to determine itsalt
value:alt
prop (""
is the only valid value)alt
property (set in Prismic)fallbackAlt
prop (""
is the only valid value)The error recommends setting Alternative Text in Prismic along with instructions on marking the image as decorative, if desired.
This error message is displayed just before
next/image
's built-in error which is logged in the same case as the above message. There is no way to disable thenext/image
error without providing an alt value, so this PR lets both errors log.Checklist:
🐺