-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
.json files prefixed with underscores don't get ignored inside content collections on build #7154
.json files prefixed with underscores don't get ignored inside content collections on build #7154
Comments
I believe this is a regression from 2.5. This used to work with 2.4. |
Yes, 2.5 added data collections. Before that, JSON files were never processed, underscore or not |
Hi @bholmesdev, I just updated to Astro 2.5.6 and seem to be having a similar, but slightly different issue. I have the following folder structure:
My json data ( I am getting the same issue where the build fails because it does not match the collection schema. May I ask if this is the intended behavior and it is required for json files to be always prefixed with an underscore even if it's already in a directory prefixed with an underscore? |
Ah, definitely an oversight. I see what we missed @tonydangblog. Reopening to make that fix |
This issue is back since cc @bholmesdev |
What version of
astro
are you using?2.5.1
Are you using an SSR adapter? If so, which one?
N/A
What package manager are you using?
pnpm
What operating system are you using?
macOS
What browser are you using?
Arc
Describe the Bug
I have the following folder structure:
(I refer to
_some-data.json
from my layout through some arcane way that does not matter in this context.)In dev, this works,
_some-data.json
is ignored, as files prefixed with underscores should be. In build however,_some-data.json
is being passed through the Zod schema as if it was a file that needs to respect theblog
schema. I would like for this file to be completely ignored, like it is in build.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-nxjeur?file=src/content/blog/my-article/my-article.md,src/pages/index.astro,src/content/blog/my-article/_my-data.json&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: