TypeError: ctx.sls.service.package.include.push is not a function

48 Views Asked by At

I'm trying to include static files with my lambda function. I am receiving the this error when trying to deploy:

TypeError: ctx.sls.service.package.include.push is not a function

This is the relevant part of my serverless.yml.

package:
  include: ../shared/static/**
1

There are 1 best solutions below

0
On BEST ANSWER

The issue was package.include expects an array, but I passed it a string. In yaml, an array (called a sequence) is denoted with a new line, a dash, and a space for each element.

package:
  include: 
    - ../shared/templates/**

YAML docs on defining sequences