Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various errors in projects created using Starlight templates #2519

Open
1 task
chaegumi opened this issue Oct 29, 2024 · 2 comments
Open
1 task

Various errors in projects created using Starlight templates #2519

chaegumi opened this issue Oct 29, 2024 · 2 comments

Comments

@chaegumi
Copy link

chaegumi commented Oct 29, 2024

What version of starlight are you using?

0.28.4

What version of astro are you using?

4.16.7

What package manager are you using?

npm,yarn,pnpm

What operating system are you using?

all

What browser are you using?

chrome

Describe the Bug

pnpm create astro --template starlight

08:02:48 watching for file changes...
08:03:16 [ERROR] [InvalidContentEntryFrontmatterError] docs → index.mdx frontmatter does not match collection schema.
hero.image: Did not match union:
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-frontmatter-error/
Stack trace:
at /home/projects/nbwiyqrqpx.github/src/content/docs/index.mdx
[...] See full stack trace in the browser, or rerun with --verbose.

TypeError: Cannot read properties of undefined (reading 'some')
at hasOneOf (G:\workspace\astro\starlight\node_modules.pnpm@[email protected][email protected][email protected][email protected]_\node_modules@astrojs\starlight\utils\head.ts:43:14)
at hasTag (G:\workspace\astro\starlight\node_modules.pnpm@[email protected][email protected][email protected][email protected]_\node_modules@astrojs\starlight\utils\head.ts:27:11)
at G:\workspace\astro\starlight\node_modules.pnpm@[email protected][email protected][email protected][email protected]_\node_modules@astrojs\starlight\utils\head.ts:64:38
at Array.filter ()
at mergeHead (G:\workspace\astro\starlight\node_modules.pnpm@[email protected][email protected][email protected][email protected]_\node_modules@astrojs\starlight\utils\head.ts:64:21)
at Module.createHead (G:\workspace\astro\starlight\node_modules.pnpm@[email protected][email protected][email protected][email protected]_\node_modules@astrojs\starlight\utils\head.ts:9:10)
at G:\workspace\astro\starlight\node_modules.pnpm@[email protected][email protected][email protected][email protected]_\node_modules@astrojs\starlight\components\Head.astro:97:14
at AstroComponentInstance.Head [as factory] (G:\workspace\astro\starlight\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\astro\dist\runtime\server\astro-component.js:16:12)
at AstroComponentInstance.init (G:\workspace\astro\starlight\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\astro\dist\runtime\server\render\astro\instance.js:32:29)
at AstroComponentInstance.render (G:\workspace\astro\starlight\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\astro\dist\runtime\server\render\astro\instance.js:42:36)

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-vp8nbb?file=package.json

Participation

  • I am willing to submit a pull request for this issue.
@delucis
Copy link
Member

delucis commented Oct 29, 2024

Thanks for the issue @chaegumi. I took a look at the reproduction but don’t see this error. Are there some more steps needed?

From this error you shared:

docs → index.mdx frontmatter does not match collection schema.
  hero.image: Did not match union:

It looks like it’s an issue with the hero image in src/content/docs/index.mdx but in the reproduction that looks good and is working in the preview as expected.

@xtfer
Copy link

xtfer commented Nov 14, 2024

I have the same issue with

docs → index.mdx frontmatter does not match collection schema.
  hero.image: Did not match union:

I've copied the code directly from https://starlight.astro.build/reference/frontmatter/#hero and I still get the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants