Several of our plugins require sharp@^0.21.3 which does _not_ resolve to the latest version of sharp.
[email protected] 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!).
Upgrade to Node 12. Run gatsby new something and see the yarn install or npm install step fail as in #13780
It should successfully install
It doesn't.
Node 12, [email protected].
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.
See #13646
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.
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.
@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.
https://github.com/gatsbyjs/gatsby/pull/13646 was merged (sharp updates and warning messages), so this this is handled
Most helpful comment
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
sharpand document what is needed to be done to resolve errors that show up when you have mismatched sharp versions.