This is probably something obvious but I can’t figure out this issue. So I just followed tutorial on settings up serverless with Google Cloud Functions. Deployment runs successfully, I see new function in the GCP portal and can execute it from there. But trying to execute it via serverless always fails with following error: Error: Function paymentProviders in region europe-west3 in project *** does not exist
. I have tried changing both function name(I tried “payment-providers”, “paymentProviders” and just “providers”), I have tried changing handler name. Nothing worked for me. What am I missing?
Hey rnd_dev, can you share more information? What does the serverless.yaml file look like specifically for the function / environment and what command are you using to test the function? Any other relative information would be great to include. Obviously keep any sensitive/secure data out of the posts
I am using serverless invoke --function providers
. Here is my current config:
service: market-intelligence
provider:
name: google
stage: dev
runtime: nodejs10
region: europe-west3
project: project-name
credentials: ~/.gcloud/key.json
plugins:
- serverless-google-cloudfunctions
- serverless-plugin-typescript
package:
exclude:
- node_modules/**
- .gitignore
- .git/**
functions:
providers:
handler: getProviders
events:
- http: path
As for javascript file:
exports.getProviders = (request, response) => {
response.status(200).send('Hello World!');
};
I am invoking function like this:
serverless invoke --function providers