Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Conversation

@josete89
Copy link
Contributor

@josete89 josete89 commented Mar 1, 2019

Fix the issue ->

TypeError: Cannot set property 'pythonRequirements' of undefined
at ServerlessPythonRequirements.createLayers (/Users/alcaljos/Projects/GMR/gmr-imu-video-synch/node_modules/serverless-python-requirements/lib/layer.js:28:56)
From previous event:

Since the layers object seems to not be initialized.

Fix the issue ->  

TypeError: Cannot set property 'pythonRequirements' of undefined
    at ServerlessPythonRequirements.createLayers (/Users/alcaljos/Projects/GMR/gmr-imu-video-synch/node_modules/serverless-python-requirements/lib/layer.js:28:56)
From previous event:

Since the layers object seems to not be initialized.
Copy link
Contributor

@dschep dschep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually fix it? It doesnt seem like it would I'd imagine you need to do this:

  if (!this.serverless.service.layers) {    
    this.serverless.service.layers = {}
  }

Check if it's null or undefifned
dschep
dschep previously approved these changes Mar 4, 2019
@dschep dschep dismissed their stale review March 4, 2019 18:01

Wait, no, you're still setting the layer itself, not the layers object

@dschep dschep merged commit 6b5e0e2 into serverless:master Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants