Skip to content

Cannot set property 'pythonRequirements' of undefined #374

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

Closed
petergaultney opened this issue Jun 24, 2019 · 1 comment
Closed

Cannot set property 'pythonRequirements' of undefined #374

petergaultney opened this issue Jun 24, 2019 · 1 comment

Comments

@petergaultney
Copy link

I am probably just misunderstanding how layers are supposed to work.

I have

functions:
  getWorkflow:
    handler: vision_workflow.api.AS_LAM_getWorkflow
    memorySize: 1024
    layers:
      - {Ref: PythonRequirementsLambdaLayer}

custom:
  pythonRequirements:
    layer: true
    slim: true
    useDownloadCache: true
    noDeploy: []

and I get this:

Serverless: Packaging Python Requirements Lambda Layer...

  Type Error ---------------------------------------------

  Cannot set property 'pythonRequirements' of undefined

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

TypeError: Cannot set property 'pythonRequirements' of undefined
    at ServerlessPythonRequirements.createLayers (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless-python-requirements/lib/layer.js:28:56)
From previous event:
    at ServerlessPythonRequirements.layerRequirements (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless-python-requirements/lib/layer.js:57:6)
From previous event:
    at Object.after [as hook] (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless-python-requirements/index.js:181:10)
    at BbPromise.reduce (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/classes/PluginManager.js:391:55)
From previous event:
    at PluginManager.invoke (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/classes/PluginManager.js:391:22)
    at PluginManager.spawn (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/classes/PluginManager.js:409:17)
    at Deploy.BbPromise.bind.then (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/plugins/deploy/deploy.js:117:50)
From previous event:
    at Object.before:deploy:deploy [as hook] (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/plugins/deploy/deploy.js:107:10)
    at BbPromise.reduce (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/classes/PluginManager.js:391:55)
From previous event:
    at PluginManager.invoke (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/classes/PluginManager.js:391:22)
    at PluginManager.run (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/classes/PluginManager.js:422:17)
    at variables.populateService.then.then (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/Serverless.js:157:33)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at Serverless.run (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/lib/Serverless.js:144:8)
    at serverless.init.then (/Users/peter/workspace/vision-nx-aws/vision-nx-workflow/node_modules/serverless/bin/serverless:44:28)
    at <anonymous>
@petergaultney
Copy link
Author

This had to do with not having Serverless >= 1.34 installed. The documentation should be updated to note the new version required.

@dschep dschep closed this as completed in 0ecd2be Jul 23, 2019
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

No branches or pull requests

1 participant