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: lock down sharp to v0.32.6 due to installation errors in AWS lambda #5651

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

jsdalton
Copy link
Member

@jsdalton jsdalton commented Dec 4, 2023

Purpose

  • Sharp introduced a new installation packaging set up where they distribute prebuilt binaries. Details here Enhancement: Major overhaul of installation lovell/sharp#3750. This was released in v0.33.0 which we upgraded to (via dependabot) a few days ago.
  • The change broke the image generator with the following errors:
Error: Could not load the \"sharp\" module using the linux-x64 runtime
Possible solutions:
- Add platform-specific dependencies:
    npm install --os=linux --cpu=x64 sharp
  or
    npm install --force @img/sharp-linux-x64
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/var/task/7dFRjNacIIBFc6CVoVP822/node_modules/sharp/lib/sharp.js:85:9)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/var/task/7dFRjNacIIBFc6CVoVP822/node_modules/sharp/lib/constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)"

Approach

  • Downgrade and pin to 0.32.6 until we can get the installation working
  • Local testing was not successful thus far

Testing steps

  • Tested old version locally in sandbox and it worked

Breaking Changes

Dependencies and/or References

Deployment

@jsdalton jsdalton requested a review from a team as a code owner December 4, 2023 23:57
Copy link

netlify bot commented Dec 4, 2023

Deploy Preview for ecommerce-app-base-components canceled.

Name Link
🔨 Latest commit 83e4be9
🔍 Latest deploy log https://app.netlify.com/sites/ecommerce-app-base-components/deploys/656e675ee57f710008b1a94e

@jsdalton jsdalton enabled auto-merge December 4, 2023 23:59
Copy link
Contributor

@matthew-gordon matthew-gordon left a comment

Choose a reason for hiding this comment

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

LGTM

@jsdalton jsdalton merged commit be167eb into master Dec 4, 2023
@jsdalton jsdalton deleted the fix/install-sharp-aws branch December 4, 2023 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants