Skip to content

Content collection validation errors in v6 are no longer human-readable #15976

@smn-cds

Description

@smn-cds

Astro Info

Astro                    v6.0.5
Node                     v24.13.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Astro v6 appears to have regressed the formatting of content collection validation errors.

When a content entry fails schema validation, the error output now includes what looks like a raw serialized zod error instead of a human-readable message. In practice, this makes the important information harder to spot and makes the output feel accidental rather than intentional.

For example, I have a collection entry missing a required label property. Running astro dev produces:

[InvalidContentEntryDataError] test-collection → test-entry data does not match collection schema.

  **: [
  {
    "expected": "object",
    "code": "invalid_type",
    "path": [
      "label"
    ],
    "message": "label: Required"
  }
]

  Hint:
    See https://docs.astro.build/en/guides/content-collections/ for more information on content schemas.
  Error reference:
    https://docs.astro.build/en/reference/errors/invalid-content-entry-data-error/

The **: line in particular looks unintended, and the validation details are shown as a raw zod error dump instead of a concise user-facing message.

What's the expected result?

The same validation failure should be presented in a clearer, human-readable format - restoring Astro v5's behaviour.

Link to Minimal Reproducible Example

I can provide a repro repo if needed, but the issue is straightforward to reproduce:

  • Create a content collection.
  • Add a invalid JSON entry.
  • Run astro dev.

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly impacts performance (priority)pkg: astroRelated to the core `astro` package (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions