Skip to content

Handle undefined function package.exclude #38

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

Merged
merged 2 commits into from
Sep 30, 2017

Conversation

pjsier
Copy link
Contributor

@pjsier pjsier commented Sep 29, 2017

I'm using a service with the package rules:

package:
  exclude:
    - node_modules/@serverless-chrome/**

and then re-including that for only one of the functions to keep the package sizes down with:

functions:
  hello_world:
    package:
      include:
        - node_modules/@serverless-chrome/**

Currently, when I do that I get the error Cannot read property 'Symbol(Symbol.iterator)' of undefined because the prepare function only sets defaults for package if it does not exist at all, and doesn't check that it has both include and exclude.

My workaround for that has been to add an arbitrary path to exclude, but I added a default empty array here in case exclude is undefined. Let me know if there's anything you'd like me to update on this!

@schickling
Copy link
Contributor

Thanks for the PR. Can you add a code comment in the line above to briefly describe what the code below does?

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