diff --git a/.changeset/fuzzy-bats-try.md b/.changeset/fuzzy-bats-try.md new file mode 100644 index 000000000000..c4aa53caf951 --- /dev/null +++ b/.changeset/fuzzy-bats-try.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Includes "undefined" in types for getEntry diff --git a/packages/astro/templates/content/types.d.ts b/packages/astro/templates/content/types.d.ts index 0727ac2e5578..14b57053c37d 100644 --- a/packages/astro/templates/content/types.d.ts +++ b/packages/astro/templates/content/types.d.ts @@ -92,7 +92,9 @@ declare module 'astro:content' { collection: C, id: E, ): E extends keyof DataEntryMap[C] - ? Promise + ? string extends keyof DataEntryMap[C] + ? Promise | undefined + : Promise : Promise | undefined>; /** Resolve an array of entry references from the same collection */