agutoli / serverless-layers

Serverless.js plugin implementing AWS Lambda Layers, reducing lambda size, warm-up, and deployment time.
MIT License
229 stars 54 forks source link

Lambda layer install skipped because it has no other layers #112

Closed samuelcastro closed 1 year ago

samuelcastro commented 2 years ago

Hi, after setup my layers pointing to a bucket I'm getting this warning:

Serverless: [ LayersPlugin ]: => default
... ○ Uploading layer package...
... ○ OK...
... ○ New layer version published...
... ○ Uploading remote /Users/scastro/Projects/Samuel/my-project/package.json...
... ○ OK...
... ○ Adding layers...
... ✓ provider - arn:aws:lambda:us-east-1:*********:my-project-dev-nodejs-default:1
... x (Skipped) function.function1 - because it has no other layers
... x (Skipped) function.function2 - because it has no other layers
... x (Skipped) function.function3 - because it has no other layers
... x (Skipped) function.function4 - because it has no other layers
... x (Skipped) function.function5 - because it has no other layers
...
...

This is my setup:

serverless-layers:
    layersDeploymentBucket: ${ssm:/my-project/${self:custom.stage}/layer-deployment-bucket}

Versions:

    "serverless": "2.69.1",
    "serverless-layers": "^2.5.4",

Any thoughts?

johndavidback commented 2 years ago

Getting the same message - layer is being successfully built but is NOT attaching to any functions, despite explicitly listing them

serverless-layers:
    dependenciesPath: ./requirements.txt
    functions:
      - login
      - getnonce
      - contracts
      - cookie-authorizer

... x (Skipped) function.login - because it has no other layers
... x (Skipped) function.getnonce - because it has no other layers
... x (Skipped) function.contracts - because it has no other layers
... x (Skipped) function.cookie-authorizer - because it has no other layers`

[ LayersPlugin ]: => Layers Info
... ∅ (skipped) function.login
... ∅ (skipped) function.getnonce
... ∅ (skipped) function.contracts
... ∅ (skipped) function.cookie-authorizer
paulhobbel commented 2 years ago

Downgrading to 2.5.3 fixes that issue, seems to be related to a change that was done here: https://github.com/agutoli/serverless-layers/commit/5a3c6b7635f5198dd9b930955a80eea505d288c8#diff-bfe9874d239014961b1ae4e89875a6155667db834a410aaaa2ebe3cf89820556R411

That if check is not correct, this now makes it so functions are always skipped

advissor commented 2 years ago

npm install -D serverless-layers@2.5.3 --save helped

agutoli commented 1 year ago

new version 2.6.1