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

Improve error message with invalid configuration #2656

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Dec 6, 2024

Description

The integration expects an object for its configuration and we assume that this user input is always an object and we unpack it into variables from the integration parameters.

This can lead to confusing error messages when the user inputs an invalid configuration or even no configuration at all, e.g. after running npx astro add starlight.

This PR adds an extra check to ensure that the configuration is an object and throws a more helpful error message if it is not.

image

Verified

This commit was signed with the committer’s verified signature.
rajrohanyadav Rohan Yadav
Copy link

changeset-bot bot commented Dec 6, 2024

🦋 Changeset detected

Latest commit: c3470c4

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 Dec 6, 2024
Copy link

netlify bot commented Dec 6, 2024

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit c3470c4
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/6752c102d03d270008f6968a
😎 Deploy Preview https://deploy-preview-2656--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@astrobot-houston
Copy link
Collaborator

astrobot-houston commented Dec 6, 2024

size-limit report 📦

Path Size
/index.html 6.15 KB (+0.02% 🔺)
/_astro/*.js 22.41 KB (+0.01% 🔺)
/_astro/*.css 13.73 KB (0%)

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, very nice improvement for folks. Thank you for spotting this!

@delucis delucis added the 🌟 patch Change that triggers a patch release label Dec 6, 2024
@delucis delucis merged commit 4d543be into main Dec 11, 2024
15 checks passed
@delucis delucis deleted the hd-invalid-user-config-type-error branch December 11, 2024 18:47
@astrobot-houston astrobot-houston mentioned this pull request Dec 11, 2024
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Dec 13, 2024
* main:
  [ci] release (withastro#2634)
  ci: update file icons (withastro#2663)
  i18n(ru): update ru.json (withastro#2642)
  Improve error message with invalid configuration (withastro#2656)
  docs: use single listener in icons reference (withastro#2657)
  fix: use seti ui repo to generate file icons (withastro#2648)
  Fix favicon support for query and fragment in URLs (withastro#2645)
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.

npx astro add starlight results in broken astro.config.mjs
3 participants