Content Loader: Ambiguous error message when required id
key is missing from collection entries.
#11953
Labels
- P2: nice to have
Not breaking anything but nice to have (priority)
feat: content layer
Related to the Content Layer feature (scope)
feat: errors
Related to error handling / messages (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Currently if entries of a collection declared in the
content/config.ts
is missing the requiredid
key, Astro throws the following error:As the entries often come from a remote source, TypeScript cannot inform user that the entries are missing the id key. Build error could though.
What's the expected result?
A clear message pointing to the missing key should be provided during the build.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-vostqd-rwqk5v?file=src%2Fcontent%2Fconfig.ts
Participation
The text was updated successfully, but these errors were encountered: