hi all. i’m combining SEED, SST, and sharp: an unh...
# seed
d
hi all. i’m combining SEED, SST, and sharp: an unholy trifecta (no shade against SST or SEED, sharp makes everything it touches unholy). for SST, i added the
layers/sharp
directory and extracted this zip file into it: https://github.com/Umkus/lambda-layer-sharp/releases as described here https://serverless-stack.com/examples/how-to-automatically-resize-images-with-serverless.html local deployment works, but SEED deployment fails since
layers/sharp/nodejs/node_modules
isn’t committed to git. should i solve this by having a SEED
before_compile
step where i download and extract that zip file?
this is the error message from SEED
Error: Cannot find asset at /tmp/seed/source/layers/sharp
r
We do it with
Copy code
const sharpLayer = new LayerVersion(ctx.stack, 'SharpLayer', {
  code: Code.fromAsset('layers/sharp'),
  compatibleRuntimes: [Runtime.NODEJS_14_X, Runtime.NODEJS_16_X],
});
and the layers/sharp folder looks like this:
d
thanks @Ross Coundon. my configuration is identical. the issue is with deploying to SEED — the node_modules within layers/sharp directory isn’t in git, so the files aren’t found during deployment.
btw, i did add them to git and deployment works with them there. but that’s ugly, so i’m putting together the
before_compile
hook to download the zip file, then unzip it
r
Ah, we do commit it to git
and Seed’s happy
d
maybe i’ll just keep doing that then