Skip to content

SVG imports fail schema validation #3114

@natemoo-re

Description

@natemoo-re

What version of starlight are you using?

0.33.2

What version of astro are you using?

5.6.2

What package manager are you using?

pnpm

What operating system are you using?

n/a

What browser are you using?

n/a

Describe the Bug

When using the experimental.svg flag in Astro 5.6.2, passing an imported .svg file to the <StarlightPage frontmatter={{ hero: { image: {} } }} /> component results in an schema validation error.

Expected Result

No validation error

Actual Result

Invalid frontmatter props passed to the <StarlightPage/> component.

hero.image: Did not match union.
Expected type { file: object } | { dark: object; light: object } | { html: string }
Received {}

Link to Minimal Reproducible Example

https://stackblitz.com/github/natemoo-re/astro-repro-svg-schema

Note: the /core and /from-markdown routes do not throw an error, the error seems to be limited to the frontmatter prop.

Participation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions