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): only log missing plugin error in development #32335

Merged
merged 3 commits into from Aug 11, 2021
Merged

fix(gatsby-plugin-image): only log missing plugin error in development #32335

merged 3 commits into from Aug 11, 2021

Conversation

redabacha
Copy link
Contributor

Description

Stops the error message for missing install of gatsby-plugin-image from appearing in non-development environments. Useful when the image component is intentionally used outside of gatsby such as storybook.

Documentation

Related Issues

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 12, 2021
@wardpeet
Copy link
Contributor

I'm curious why this is a problem? I would suggest moving to a warn instead if it's breaking something in storybook.

@wardpeet wardpeet 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 Jul 16, 2021
@redabacha
Copy link
Contributor Author

@wardpeet
this is a problem when bundling code that uses gatsby-plugin-image separately from gatsby, i gave storybook as an example here but it applies in production environments such as cra/next.js as well that want to use the fallback behaviour provided in gatsby-plugin-image without mocking the entire library.

@wardpeet
Copy link
Contributor

wardpeet commented Aug 4, 2021

can you also change console.error into .warn please

wardpeet
wardpeet previously approved these changes Aug 4, 2021
@wardpeet wardpeet added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Aug 4, 2021
@wardpeet wardpeet merged commit 4483ff4 into gatsbyjs:master Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants