-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Add more diagnostic help to error messages thrown by <Steps>
#1838
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
🦋 Changeset detectedLatest commit: 8b79c5c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Played with a few broken scenarios locally and even on an Astro docs branch with a few steps errors, and it definitely helps a lot already imo. Great improvement 🌟
* main: i18n(zh-cn): Update docs about synced-tabs (withastro#1834) i18n(zh-cn): Update some docs about withastro#1620 & withastro#1613 (withastro#1835) Add more diagnostic help to error messages thrown by `<Steps>` (withastro#1838) i18n(zh-cn): Update components.mdx (withastro#1836) i18n(zh-cn): Update community-content.mdx (withastro#1833) Improve type checking job (withastro#1831) [ci] format [ci] release (withastro#1832) i18n(ru): update ru.json (withastro#1826) Fix `<Tabs>` sync issue with inconsistent use of `icon` on `<TabItem>` components (withastro#1811) Enable `BASE_URL` tests (withastro#1828)
Description
Follow up to some feedback from @yanthomasdev that it was hard to figure out which
<Steps>
component was erroring in buildsThe
<Steps>
component now logs the HTML it receives as part of the hints in error messages:This is still relatively verbose and not 1:1 with what is authored because
<Steps>
receives the HTML rendered by Astro instead of the raw Markdown an author wrote, but is hopefully still helpful for locating which instance of<Steps>
is causing issues.Notes
@HiDeoo also suggested using a global remark plugin to check structure and be able to error with proper positional information in the authored Markdown. This could indeed be nicer, but would not work in Markdoc and would add extra overhead to all content processing, vs. this approach which only runs the error logic on the children of
<Steps>
.We can consider potential refinements to this output in the future if we hear from people that this verbose logging is too overwhelming.