🐛 BUG: Astro check silently exists and doesn't report type errors when there are collection schema validation errors #982
angelikatyborska
started this conversation in
Feature requests
Replies: 2 comments 2 replies
-
Moving this to a discussion / feature request, since it's not a bug |
Beta Was this translation helpful? Give feedback.
2 replies
-
Moving this to the main repo at the request of @florian-lefebvre to investigate the astro sync part |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the Bug
astro check
does not finish running and exits silently without reporting any errors when the following conditions are met:defineCollection
with a schemaI have experienced this when I was trying to add typescript to my blog and couldn't figure out why
astro check
refuses to do any type validations. I realized what's going on only after I ranastro sync
and fixed collection schema validation errors errors.I suspect that this bug might affect reporting not only typescript errors, but also other checks that Astro runs.
Steps to Reproduce
npm create astro@latest
using the official blog template (or checkout https://github.com/angelikatyborska/astro-check-bug and skip to step 6)@astro/check
andtypescript
.astro
files, e.g.const foo: string = 3; console.log(foo);
npm run astro check
and observe that the TS error is reported:first-post.md
, settitle: 3
(it's supposed to be a string, not a number)npm run astro check
again and observe no errors of any kind reported, but the process does exit with status 1.What I would expect to happen instead, is to see the same errors as I see when I run
npm run astro sync
:Link to Minimal Reproducible Example
https://github.com/angelikatyborska/astro-check-bug
Beta Was this translation helpful? Give feedback.
All reactions