firebase / firebase/functions-samples
[BUG] in sample: stripe (FUNCTION_NAME)
- Dominant language
- JavaScript
- Stars
- 12.2k
- Forks
- 3.8k
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 1
Description
### Which sample has a bug?
[Create Stripe customers and charge them on Firestore write](https://github.com/firebase/functions-samples/tree/main/stripe)
### 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**

### 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`
Contributor guide
Assessment
This issue has not been assessed yet.