Content collection does not recognize frontmatter with .JPG
(uppercase)
#12621
Labels
feat: content collections
Related to the Content Collections feature (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Chome
Describe the Bug
In Astro 4, we can have frontmatter to images like
teaserImage: /src/assets/subprojects/schulexpress/teaserImage.JPG
In Astro 5, the images with uppercase
.JPG
are not transformed to an image object:As a result, I am getting the missleading
MissingImageDimension
error.I am assuming this is due to some changes in the glob pattern which now do not look for
JPG
(uppercase) anymore.I had a similar issue with https://docs.astro.build/en/recipes/dynamically-importing-images/ where it states to use
const images = import.meta.glob<{ default: ImageMetadata }>('/src/assets/*.{jpeg,jpg,png,gif}');
however we have to useconst images = import.meta.glob<{ default: ImageMetadata }>('/src/assets/**/*.{jpeg,jpg,png,gif,webp,JPG,JPEG,PNG,GIF}')
What's the expected result?
Uppercase file endings should work just like lowercase.
Or there should be a better error and warning.
About my Minimal Reproducible: I cannot get this to work because Stackblitz does not show any results and complains about
Cannot find module 'astro:content' or its corresponding type declarations.(2307)
. But the basic setup is there.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-e6sxdg?file=src%2Fcomponents%2FCollection.astro,content.config.ts&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: