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

Unknown Content Collection Error when parent directory starts with an underscore #6329

Closed
1 task
justtobetrendy opened this issue Feb 22, 2023 · 0 comments · Fixed by #6330
Closed
1 task
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@justtobetrendy
Copy link

What version of astro are you using?

2.0.14

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

Hello,

I was experimenting with Astro and was constantly getting an Unknown Content Collection Error when accessing the /blog URL of the blog template site.

Steps to reproduce

  1. mkdir _sandbox, cd _sandbox (the underscore is important)
  2. npm create astro@latest, create it in ./blog, select Use blog template, install dependencies, initialize git repo and select Strict TypeScript configuration.
  3. cd blog
  4. npm run dev
  5. navigate to http://localhost:3000/blog

What I noticed was:

  1. the type definition were not generated in ./astro when running npm run dev or npm run astro sync,
  2. this works in astro@2.0.6 but stopped working in astro@2.0.7,
  3. removing the underscore from the parent directory (create it in sandbox directory rather than _sandbox) resolves the issue in astro@2.0.14.

Note that I can't reproduce this on stackblitz since I do not have control over the parent directory.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-2gphvs?file=package.json,src%2Fcontent%2Fconfig.ts,.gitignore

Participation

  • I am willing to submit a pull request for this issue.
@MoustaphaDev MoustaphaDev added the - P4: important Violate documented behavior or significantly impacts performance (priority) label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants