-
Notifications
You must be signed in to change notification settings - Fork 291
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
sls deploy function -f <function> does not work - TypeError: Cannot read property 'runtime' of undefined #605
Comments
I did some further testing and investigation and maybe this helps others to help figure out what is going wrong. If you use:
And you have enabled this plugin with Lamdba layers, you cannot deploy an individual function.
Looking further at the code, the strange part is this, when an individual function is specified, example:
Lets look at index.js specific the
This will return a "String" as the function name if an individual function is specified not an Array if all functions are to be deployed. Now looking at
If you look at this, we can see that if you have set package indiividually to true, this "targetFuncs" is expected to return an "Array" - as "filter" is used, but a string is passed in not an array. Maybe this helps to solve this issue. |
I am also trying to figure out this. Really need to solve this. |
It's not that Having hacked that change in to my local version of the plugin, it no longer exhibits this error. |
There is no attribute called functionObj on the processedInput.options object. serverless#605
Thank you - I have applied the change and it works! |
Is there any plan to bundle this fix into a release? |
@pgrzesik are there any plans to merge the PR for this? This has been ongoing for a while and it seems the fix has been ready for over a month now. |
Hey @dalecampbell, the PR is not complete as it doesn't include a test case, I've just wrote a comment about that, if we don't hear from the original author then we're open to other contributions. |
Any update @pgrzesik ? |
Hey @dalecampbell - no updates from the original author - I think at this point we should accept an alternative contributions if anyone would like to solve that problem |
Sorry you've run into that issue @pharindoko If anyone interested in taking over the PR that fixes it, we'll be happy to accept the contribution 🙌 |
Fix added as per recommendation from: serverless#605 (comment)
If you are using the latest serverless (I have tried 2.34 and above) with this plugin and try and update one function you get
TypeError: Cannot read property 'runtime' of undefined
Any ideas why this fails if the plugin is enabled? This used to work well in earlier versions.
Any help or ideas to solve this would be awesome.
Example output:
You can easily duplicate this using the example api - https://github.com/serverless/examples/tree/master/aws-python-rest-api with few small updates - see example serverless.yaml below.
Example requirements.txt with a module in there.
Environment Details
The text was updated successfully, but these errors were encountered: