unable to run watchmessages in nodejs14
same here, the problem seems to be from @google-cloud/express-oauth2-handlers, as mentioned #here
Any solutions??

how to solve this?
I resolved it but this is not an ideal solution, in light of https://github.com/GoogleCloudPlatform/express-oauth2-handlers/issues/11, I had to
a) add to pubsub/index.js line 1...
process.env.GCP_PROJECT = 'enter your gcp project here' // GCP_PROJECT cannot be added to env_vars.yaml as redeployment will push this to a supported version of node
b) deploy with deprecated runtime node v8
gcloud functions deploy watchGmailMessages --runtime=nodejs8 --trigger-topic=gmail-watch --env-vars-file=env_vars.yaml
Hey guys,
since node10 there were some changes there as indicated in the documentation
FUNCTION_TRIGGER_TYPE | Use the FUNCTION_SIGNATURE_TYPE environment variable instead
https://cloud.google.com/functions/docs/migrating/nodejs-runtimes
since the dependencies are not updated, just add FUNCTION_TRIGGER_TYPE as CLOUD_PUBSUB_TRIGGER (env variables)
FUNCTION_TRIGGER_TYPE: CLOUD_PUBSUB_TRIGGER
with these changes it works as expected and as it did with node8
GCP Node10 runtime introduced some environment variable changes which require modificiatons of the source code.