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(gatsby-plugin-image): Better StaticImage errors #30271

Merged
merged 2 commits into from
Mar 17, 2021

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Mar 16, 2021

The error when props were not resolved in StaticImage was unclear, leading to a lot of confusion, e.g. in #30143 . This PR uses the babel node path to generate a structured error, with a codeframe and link to the docs

image

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 16, 2021
@ascorbic ascorbic added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 16, 2021
Copy link
Contributor

@laurieontech laurieontech left a comment

Choose a reason for hiding this comment

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

Minor edits and a question. But this is a major quality of life improvement!

Co-authored-by: LB <laurie@gatsbyjs.com>
Copy link
Contributor

@laurieontech laurieontech left a comment

Choose a reason for hiding this comment

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

LGTM

@ascorbic ascorbic merged commit 8a0a4e8 into master Mar 17, 2021
@ascorbic ascorbic deleted the fix/static-image-errors branch March 17, 2021 09:04
@ascorbic ascorbic added this to To cherry-pick in V3 Release Hotfixes via automation Mar 17, 2021
wardpeet pushed a commit that referenced this pull request Mar 18, 2021
* fix(gatsby-plugin-image): Better StaticImage errors

* Apply suggestions from code review

Co-authored-by: LB <laurie@gatsbyjs.com>

Co-authored-by: LB <laurie@gatsbyjs.com>
(cherry picked from commit 8a0a4e8)
@wardpeet wardpeet moved this from To cherry-pick to Backport PR opened in V3 Release Hotfixes Mar 18, 2021
wardpeet added a commit that referenced this pull request Mar 18, 2021
* fix(gatsby-plugin-image): Better StaticImage errors

* Apply suggestions from code review

Co-authored-by: LB <laurie@gatsbyjs.com>

Co-authored-by: LB <laurie@gatsbyjs.com>
(cherry picked from commit 8a0a4e8)

Co-authored-by: Matt Kane <matt@gatsbyjs.com>
@wardpeet wardpeet moved this from Backport PR opened to Backported in V3 Release Hotfixes Mar 23, 2021
@vladar vladar moved this from Backported to Archived in V3 Release Hotfixes Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants