For example, for a serverless.yml similar to this:
service: "test"
provider:
stage: "${opt:stage}"
name: "aws"
functions:
foo:
handler: "handler.foo"
events:
- sns: "bar"
plugins:
- "serverless-plugin-ifelse"
custom:
serverlessIfElse:
- If: '"${opt:stage}" == "dev"'
Exclude:
- "functions.foo.events"
The above worked until serverless 1.52.0 (excluding). After the 1.52.0 release it outputs the following when trying to use the following:
TypeError: Cannot read property 'find' of undefined
Manually setting foo to have no events still allows packaging and deploying successfully, so I suspect this is a plugin bug.