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

Improve sharp upgrade experience when libvips is upgraded #16985

Closed
sidharthachatterjee opened this issue Aug 23, 2019 · 3 comments
Closed

Improve sharp upgrade experience when libvips is upgraded #16985

sidharthachatterjee opened this issue Aug 23, 2019 · 3 comments
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change

Comments

@sidharthachatterjee
Copy link
Contributor

Currently upgrading gatsby-plugin-sharp (or rather its dependency sharp) when there is a version change to the underlying libvips dependency is a little problematic because it fails with #16957 unless an npm rebuild is run.

@lovell had some lovely recommendations in lovell/sharp#1680 (comment) on how to tackle this.

We have to some extent in https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-sharp/src/safe-sharp.js but it appears that we'll have to handle this corner case as well

CC @pieh

@sidharthachatterjee sidharthachatterjee added type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change effort: low labels Aug 23, 2019
@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Sep 13, 2019
@gatsbot gatsbot bot closed this as completed Sep 24, 2019
@sidharthachatterjee sidharthachatterjee added effort: med not stale and removed effort: low stale? Issue that may be closed soon due to the original author not responding any more. labels Oct 18, 2019
@gatsbyjs gatsbyjs deleted a comment from gatsbot bot Oct 18, 2019
@gatsbyjs gatsbyjs deleted a comment from gatsbot bot Oct 18, 2019
@sidharthachatterjee sidharthachatterjee added the help wanted Issue with a clear description that the community can help with. label Oct 18, 2019
@kuworking
Copy link

If working with yarn workspaces, I have

yarn list --pattern sharp
yarn list v1.19.0
├─ gatsby-plugin-sharp@2.3.0
├─ gatsby-transformer-sharp@2.3.5
└─ sharp@0.23.2

And gatsby-node with

const sharp = require('sharp')
sharp.cache(false)
sharp.simd(false)
  1. Running npm rebuild and/or yarn --force (the equivalent that should work for workspaces?) doesn't allow gatsby build to succeed (after deleting all node_modules)
 [====================----------] 13710/20646 439.4 s 66% Generating image thumbnailsException code=0xc0000005 flags=0x0 at 0x0000000000000000. Access violation - attempting to execute data at address 0x0000000000000000
error Command failed with exit code 3221225477.
  1. Running yarn --force with
"resolutions": {
    "sharp": "0.22.1"
  }

doesn't prevent yarn to install sharp 0.23.2, and running with or without the resolutions part doesn't change the build output, identical to the previous one

  1. Downgrading to
"gatsby-plugin-sharp": "2.2.14",

creates divergences in the different packages of the workspace

yarn list --pattern sharp
yarn list v1.19.0
├─ gatsby-plugin-sharp@2.2.14
│  └─ sharp@0.22.1
├─ gatsby-theme-A@0.1.43
│  └─ gatsby-plugin-sharp@2.3.0
├─ gatsby-transformer-sharp@2.3.5
├─ sharp@0.23.3
└─ site@0.1.71
   └─ gatsby-plugin-sharp@2.3.0
Done in 0.84s.

So I also downgrade

"gatsby-plugin-manifest": "2.1.1",
"gatsby-transformer-sharp": "2.2.6",

delete node_modules and yarn-lock and run yarn --force again

which gives me

yarn list --pattern sharp
yarn list v1.19.0
├─ gatsby-plugin-sharp@2.2.14
├─ gatsby-transformer-sharp@2.2.6
└─ sharp@0.22.1

and then, build fails with a different message

Error: Cannot find module 'gatsby/dist/utils/create-content-digest'

And now I don't know what else can I try

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Jun 22, 2020
@github-actions
Copy link

github-actions bot commented Jul 2, 2020

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

@github-actions github-actions bot closed this as completed Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more. type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

No branches or pull requests

4 participants