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

Add more diagnostic help to error messages thrown by <Steps> #1838

Merged
merged 4 commits into from
May 7, 2024

Conversation

delucis
Copy link
Member

@delucis delucis commented May 7, 2024

Description

  • Follow up to some feedback from @yanthomasdev that it was hard to figure out which <Steps> component was erroring in builds

  • The <Steps> component now logs the HTML it receives as part of the hints in error messages:

    Astro error overlay showing the new error message including HTML
  • 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.

Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview May 7, 2024 9:37pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
starlight-i18n ⬜️ Ignored (Inspect) May 7, 2024 9:37pm

Copy link

changeset-bot bot commented May 7, 2024

🦋 Changeset detected

Latest commit: 8b79c5c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

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

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label May 7, 2024
@astrobot-houston
Copy link
Collaborator

size-limit report 📦

Path Size
/index.html 6.1 KB (+0.04% 🔺)
/_astro/*.js 22.01 KB (-0.01% 🔽)
/_astro/*.css 13.45 KB (0%)

Copy link
Member

@HiDeoo HiDeoo left a 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 🌟

@delucis delucis added the 🌟 patch Change that triggers a patch release label May 7, 2024
@delucis delucis merged commit 9fe8475 into main May 7, 2024
12 checks passed
@delucis delucis deleted the chris/improve-steps-error branch May 7, 2024 22:22
@astrobot-houston astrobot-houston mentioned this pull request May 7, 2024
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request May 8, 2024
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package 🌟 patch Change that triggers a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants