Function names cannot contain dashes.
See original GitHub issue[REQUIRED] Environment info
firebase-tools: 7.6.0
Platform: Windows WSL 1
[REQUIRED] Test case
Provide a function name that contains a ‘-’ The emulator will error out with an error similar to:
Error: Function name “DriveActivity-getActivity” is invalid. Function names cannot contain dashes.
The function emulator does allow for ‘.’ in the name but those are invalid in function names.
[REQUIRED] Steps to reproduce
Create a function with a ‘-’ in the name.
run firebase functions:shell
[REQUIRED] Expected behavior
According to the Functions UI in the cloud console:
Name must start with a letter followed by up to 62 letters, numbers, or hyphens, and cannot end with a hyphen
[REQUIRED] Actual behavior
The function name errors out the functions emulator.
Error: Function name “DriveActivity-getActivity” is invalid. Function names cannot contain dashes.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
function name(s) can only contain letters, numbers, hyphens ...
node. js - Failed to deploy function: function name(s) can only contain letters, numbers, hyphens, and not exceed 62 characters in length - ......
Read more >Will it be bad that a function or script name contains dash ...
Yes, it's fine to use dashes in function names in bash. Here's an example of a project using function ...
Read more >Why does Python not allow the usage of hyphens for function ...
It's true that hyphens can be used in variable names in languages such as Lisp (in fact "kebab-case" names ... A variable name...
Read more >hyphens in function names - Google Groups
Is there a rule of thumb to apply when deciding whether to separate multiple words in a function name with hyphens? I can't...
Read more >Organize multiple functions | Cloud Functions for Firebase
You may have too many functions to reasonably fit in a single file, or different teams ... lowercase letters, numeric characters, underscores, and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok I have sent out #1972 to address the confusion.
Here’s what’s going on (I asked someone who has been around Cloud Functions longer than I have):
-
in function names, but we don’t in the Firebase CLI (explained below)exports.group = { functionA: ..., functionB: ... }
we wanted to make the process intuitive and Javascript-y. So we use.
notation to refer to those functions wherever possible. You do--deploy only:group.functionA
, etc..
is not a valid name in a GCF function, when we deploy we replace the.
with a-
so that in the URL that function would be calledgroup-functionA
.functions:shell
we wanted to reflect your code, so the function is defined asgroup.functionA
. However the log message infunctions:shell
was showing the deployed name, which is wrong.So I hope that makes sense! I do agree it’s confusing but changing this decision now would be hugely disruptive for a small benefit. So I hope that #1972 reduces confusion.
Still experiencing this firebase-tools
9.23.3