🐛 BUG: Astro check silently exists and doesn't report type errors when there are collection schema validation errors #982
Replies: 3 comments 2 replies
-
|
Moving this to a discussion / feature request, since it's not a bug |
Beta Was this translation helpful? Give feedback.
-
|
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.
-
|
This issue was already resolved in withastro/astro#12724 so I'm closing the discussion. The bug no longer happens starting from Astro 5.0.6. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Bug
astro checkdoes not finish running and exits silently without reporting any errors when the following conditions are met:defineCollectionwith a schemaI have experienced this when I was trying to add typescript to my blog and couldn't figure out why
astro checkrefuses to do any type validations. I realized what's going on only after I ranastro syncand 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@latestusing the official blog template (or checkout https://github.com/angelikatyborska/astro-check-bug and skip to step 6)@astro/checkandtypescript.astrofiles, e.g.const foo: string = 3; console.log(foo);npm run astro checkand 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 checkagain 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