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

fix: throw a useful error if rendering undefined entry #12113

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Oct 3, 2024

Changes

Currently if an undefined entry is passed to render() it gives the unhelpful error about attempting to access deferredRender on undefined. This PR adds an explicit null check which throws a new AstroError if the entry is undefined.

Testing

Added a new test case and fixture

Docs

Adds a new error

Copy link

changeset-bot bot commented Oct 3, 2024

🦋 Changeset detected

Latest commit: 0b6a2c9

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

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 pkg: astro Related to the core `astro` package (scope) docs pr labels Oct 3, 2024
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

LGTM! Just a tiny changeset suggestion!

.changeset/wise-pumas-fry.md Outdated Show resolved Hide resolved
Co-authored-by: Sarah Rainsberger <[email protected]>
@ascorbic ascorbic merged commit a54e520 into main Oct 3, 2024
13 checks passed
@ascorbic ascorbic deleted the render-undefined-error branch October 3, 2024 18:55
This was referenced Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs pr pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants