Closed jmoyers closed 2 years ago
Hello @jmoyers, thanks for reporting and sorry you've run into trouble here. I've tried to reproduce your issue without running commands through yarn
as in your case and commands like these
sls deploy function --service producer --function producer
worked correctly.
In order to help debugging, could you please paste the output of your command with --verbose
enabled? Or paste the conents of .serverless/compose.log
file after running your command?
In the meantime, you might try running the command with --service
flag passed after the actual command - for Framework methods it's already enforced that options cannot appear before command and it will be the case for Compose commands in the future as well
Wohoo! That works. I'll go ahead and close.
Re-upping this:
I'm seeing the same Cannot convert undefined or null to object
error message when deploying a specific function, but only when using the following syntax: sls {service}:deploy function -f {functionName}
If I use sls {service}:deploy function --function {functionName}
, it works as expected.
Thanks @r-token - I'll investigate this π
Hey @r-token - I didn't manage to reproduce your exact error message, but I've found that shorthand options such as -f <function>
were not handled correctly. Could you share more about your specific case? What version of compose are you using?
The issue that I've discovered will be fixed with: https://github.com/serverless/compose/pull/118
Here's the output when running sls -v
:
Running "serverless" from node_modules
Framework Core: 3.17.0 (local) 3.17.0 (global)
Plugin: 6.2.2
SDK: 4.3.2
The full error message I get back when using the -f
shorthand looks like this:
Error:
TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at resolveArgsSchema (/path-to-project-root/node_modules/serverless/lib/cli/resolve-input.js:13:45)
at /path-to-project-root/node_modules/serverless/lib/cli/resolve-input.js:41:5
at memoized (/path-to-project-root/node_modules/memoizee/lib/configure-map.js:80:41)
at /path-to-project-root/node_modules/serverless/scripts/serverless.js:610:15
at /path-to-project-root/node_modules/serverless/scripts/serverless.js:745:9
at processTicksAndRejections (internal/process/task_queues.js:95:5)
I've just published v1.0.3 version of Compose, could you check if the problem still persists for you @r-token? Thanks in advance π
Updated to Compose v1.0.3
and it worked! Thank you @pgrzesik!
Use case is the following: I have a lambda layer I'd like to deploy as a service, and then several lambdas that I'd like to deploy in parallel that depend on the lambda layer. As a result, I'd like to use the layer arn as an output from one service to drive several others.
Later, I'd like to update the function code of one of the dependent lambdas, so I try to deploy via
serverless deploy function -f {function name}
-- but find that I need the lambda layer arn to be explicitly passed in as a parameter, or that I need to run it through the compose function instead. Trying to run it through the compose function, I get the above parsing error, presumably because the sub-command has "two parts" -- deploy + function.