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

[bug]: add warning in Gatsby core when multiple versions of sharp detected #13781

Closed
5 tasks done
DSchau opened this issue May 1, 2019 · 4 comments
Closed
5 tasks done
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@DSchau
Copy link
Contributor

DSchau commented May 1, 2019

Description

Several of our plugins require sharp@^0.21.3 which does not resolve to the latest version of sharp.

sharp@0.21.3 seems to have severe issues with Node 12, therefore our plugins should be upgraded to account for this. However--we want to do so in a way that is transparent to the end user, and doesn't introduce breaking changes if e.g. only one plugin is updated but others aren't (or at least warn in this scenario in Gatsby core!).

Steps to reproduce

Upgrade to Node 12. Run gatsby new something and see the yarn install or npm install step fail as in #13780

Expected result

It should successfully install

Actual result

It doesn't.

Environment

Node 12, sharp@0.21.3.

Steps

  • Upgrade sharp in gatsby-plugin-sharp
  • Upgrade sharp in gatsby-transformer-sharp
  • Upgrade sharp in gatsby-plugin-manifest
  • Upgrade sharp in gatsby-remark-images-contentful
  • Add warnings in core if our packages depend upon different versions of sharp

The last of these is being worked on by @davidbailey00 (but if someone else wants to tackle this--more than welcome to do so!), so it'd be nice to get that in before we bump the versions in the plugins to be as low-impact as possible to our end users.

Related Issues / PRs

See #13646

@DSchau DSchau added status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby labels May 1, 2019
@DSchau DSchau changed the title [bug]: issues with sharp@0.21.3 and Node 12 [bug]: add warning in Gatsby core when multiple versions of sharp detected May 1, 2019
@pieh
Copy link
Contributor

pieh commented May 1, 2019

I did more discovery on last remaining step of resolving this and it really turns out that any solution has some problems and is not guaranteed to work, so what I will do, as add "Troubleshooting" section to 4 packages that depend on sharp and document what is needed to be done to resolve errors that show up when you have mismatched sharp versions.

@cpboyd
Copy link
Contributor

cpboyd commented May 2, 2019

Out of curiosity, is there a specific reason not to change it to a peer dependency?
e.g. https://www.gatsbyjs.org/docs/migrating-from-v1-to-v2/#manually-install-plugins-peer-dependencies

That way the user gets to choose what version they install.

@vtenfys
Copy link
Contributor

vtenfys commented May 2, 2019

@cpboyd That's what we are planning on doing in Gatsby v3, but we felt that it would be detrimental if we changed the behaviour now, since it would break a lot of 3rd party Gatsby tutorials e.g. on blog sites and would require manual intervention upon upgrading packages.

@pieh
Copy link
Contributor

pieh commented May 3, 2019

#13646 was merged (sharp updates and warning messages), so this this is handled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

4 participants