serverless-google-cloudfunctions
serverless-google-cloudfunctions copied to clipboard
"invoke local" doesn't do anything
I'm using the default Node.js template. Running invoke works perfectly fine on the deployed application, but running sls invoke local -f first doesn't do anything or print anything to the console.
When logging debug info no errors are shown. It gets to Serverless: Invoke invoke:local then the process just exits.
Same here.
Any updates about it?
Same here.
Any updates about it?
Is there a workaround for this issue ?
Just ran into this problem, it seems to happen when two conditions are met:
- you run the
sls invoke localcommand via a debugger (Vscode in my case), and: - no input data was provided to
invoke local(via eitherdataorpathparameters).
In that scenario, InvokeLocal plugin gets stuck trying to read data on stdin. The problem seems to be located in get-stdin/index.js, where the condition if (stdin.isTTY) is false for some reason. May be related to the way VScode calls programs to debug?!
An easy workaround is to add a dummy --data or --path parameter to your invoke local command.
this workaround worked for you? I tried and fails here :(
This one doesn't work for me as well Any updates on this issue?
Well yes I confirm, the following config "just works" for me right now:
` {
"type": "node",
"request": "launch",
"name": "Test running lambda sls",
"program": "${workspaceFolder}/node_modules/.bin/sls",
"args": [
"invoke",
"local",
"-f",
"myLambdaFunction",
"--data",
"dummyData"
]
} `
If I remove the "--data dummyData" section, Invoke Lambda gets stuck as before. Latest Vscode, and my OS is an Ubuntu 18.04 LTS in case it matters...
Just ran into this problem, it seems to happen when two conditions are met:
- you run the
sls invoke localcommand via a debugger (Vscode in my case), and:- no input data was provided to
invoke local(via eitherdataorpathparameters).In that scenario,
InvokeLocalplugin gets stuck trying to read data on stdin. The problem seems to be located inget-stdin/index.js, where the conditionif (stdin.isTTY)is false for some reason. May be related to the way VScode calls programs to debug?!An easy workaround is to add a dummy
--dataor--pathparameter to yourinvoke localcommand.
Yeah, this workaround works for me also. I'm using windows 10 and git bash
Any update for this? Workaround dont work for me. When i invoke in shell
serverless invoke local -f first --data '{"name": "Bernie"}'
nothing happens. this doesn't do anything or print anything to the console
I also run into this issue as well. The debug output looks like this:
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Invoke invoke:local
Afterwards it stops and the return value is 0.
I am experiencing the same thing, except rather than hanging it just exits after "Serverless: Invoke invoke:local" with no output or even attempting to compile the code (introducing a deliberate syntax error doesn't have any effect). Seems like maybe this plugin is not ready for use?
Same issue here. serverless invoke local fails to produce any output, whereas the deployed function does output "Hello world". I am using Google Cloud Shell for my dev environment.
try this (assuming hello is your function name)
sls invoke local -f hello -d
Can't get it to work either.
I assume this isn't the problem any of you all are running into, but since I had the exact same symptoms (sls invoke local -f user-endpoint --data "{}" -l runs for a second and returns with no output) and wound up here from google, here was my fix:
I was running the command from the wrong director. As soon as I cd'd to the the directory containing my serverless.yml file, it worked fine. 🤦♂️
Same issue, I am using it alongside "serverless-plugin-typescript", after a lot of attempts to fix it the local invocation does not work. It compiles but will not invoke.