reference
from astro:content
no-longer validates entries exist
#13268
Labels
- P2: nice to have
Not breaking anything but nice to have (priority)
feat: content layer
Related to the Content Layer feature (scope)
requires refactor
Bug, may take longer as fixing either requires refactors, breaking changes, or considering tradeoffs
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
The
reference
helper fromastro:content:
allows you to validate frontmatter against another collection:In Astro 4, when provided with an identifier that does not exist in the referenced collection, an error would be thrown:
In Astro 5, the entries are accepted and would only fail at the time when
getEntry
/getEntries
is used andundefined
is returned.For example, when using
JSON.stringify
on thedata
of an entry and the result ofgetEntries(data.authors)
in the reproduction:What's the expected result?
Invalid entries are validated when the frontmatter is parsed or the documentation is amended to say that validation should be done by the author in the areas they are using the frontmatter.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-rm62ioqd
Participation
The text was updated successfully, but these errors were encountered: