withastro / astro · Issue No. 17589
Astro v7.1.6
Node v26.6.0
System Linux (x64)
Package Manager pnpm
Output static
Adapter none
Integrations @astrojs/mdx
@astrojs/sitemap
Astro fails to load a content collection when a Zod schema transforms a field into a Temporal.PlainDate.
The error originates from Astro's internal use of structuredClone() in updateImageReferencesInData(). Since Temporal.PlainDate is not cloneable in the current Node.js runtime, getCollection() throws a DataCloneError.
While this may ultimately depend on Node's structuredClone implementation, Astro currently doesn't document this limitation, and the failure occurs during normal content loading.
Reproduction
content.config.ts
import { defineCollection, z } from "astro:content";
const posts = defineCollection({
schema: z.object({
publishedOn: z
.string()
.transform((value) => Temporal.PlainDate.from(value)),
}),
});
export const collections = {
posts,
};
src/content/posts/example.md
---
publishedOn: 2026-08-04
---
Codeconst posts = await getCollection("posts");
Current behavior
Astro throws:
DataCloneError: [object Temporal.PlainDate] could not be cloned.
at structuredClone (...)
at updateImageReferencesInData (...)
at getCollection (...)
Expected behavior
One of the following:
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.