functions-samples icon indicating copy to clipboard operation
functions-samples copied to clipboard

[BUG] in sample: stripe (FUNCTION_NAME)

Open deremer opened this issue 4 years ago • 0 comments

Which sample has a bug?

Create Stripe customers and charge them on Firestore write

How to reproduce the issue

  1. Deploy code with node runtime later than node 8
  2. Execute code in a manner that will log an error
  3. Observe that "FUNCTION_NAME" will be undefined

Why? Because once cloud functions moved beyond Node 8, the environment variables that are exposed changed. This should now be FUNCTION_TARGET as defined here: https://cloud.google.com/functions/docs/configuring/env-var#newer_runtimes

Debug output

Screenshots

image

Expected behavior

Expect the cloud function name to be shown, but FUNCTION_NAME is not a valid env var after node 8.

Actual behavior

The name of the cloud function is undefined

deremer avatar Sep 07 '21 21:09 deremer