question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve error messaging around function dot-notation deploys

See original GitHub issue

Environment info

firebase-tools: 8.1.1 Platform: MacOs

Test case

$ firebase deploy --only functions:trig-users-onUserUpdate

Steps to reproduce

  1. Have a project setup
  2. Create a cloud function
  3. Try to deploy just that function, ex:
$ firebase deploy --only functions:trig-users-onUserUpdate

Expected behavior

...
✔  functions[trig-users-onUserUpdate(us-central1)]: Successful update operation.
...

Function deployed.

Actual behavior

i  functions: current functions in project: trig-auth-createAuthUser(us-central1), trig-auth-onDeleteUser(us-central1), trig-users-onUserUpdate(us-central1)
⚠  functions: the following filters were specified but do not match any functions in the project: trig-users-onUserUpdate

Function wasn’t deployed

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mbleighcommented, Apr 24, 2020

We use dot notation because we allow for exporting groups of functions and deploying them together, for instance:

exports.myGroup = {fn1: functions.https.onRequest(), fn2: functions.https.onRequest()}

Where I can now deploy both functions with:

firebase deploy --only functions:myGroup
# or
firebase deploy --only functions:myGroup.fn1

Function names cannot have periods in them, but the hierarchy makes dot-notation make more sense than dash notation.

I think the action here is probably to have a better error message before deploy if you include dashes (which are not allowed by our trigger parser), so I’ll leave it open and edit the title to reflect.

1reaction
MichaelGradekcommented, Apr 24, 2020

The issue is that, for some reason, the deploy --only filter expects you to use dot notation to separate the modules / directories.

If you try this, it will work:

$ firebase deploy --only functions:trig.users.onUserUpdate

i.e. change the - for .

I believe this is very counter intuitive, but it is what it is for now.

¯_(ツ)_/¯

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Write Helpful Error Messages to Improve Your App's ...
The first builds context around error messages and why they're important. This section should be useful, regardless of whether you're a ...
Read more >
Fix program errors and improve code - Visual Studio (Windows)
This article describes some basic ways Visual Studio can help you find and fix problems in your code, including build errors, code analysis, ......
Read more >
Get Started with Custom Error Handling in Spring Boot (Java)
Learn how to implement custom error handling logic in Spring Boot. You will see two approaches based on the @ControllerAdvice annotation.
Read more >
Common .NET Software Errors and How to Fix Them - Stackify
NET software errors from around the web. It includes exceptions, broken data bindings, ... NET error, see this article from Dot Net Perls....
Read more >
Top 10 errors from 1000+ Ruby on Rails projects ... - Rollbar
NoMethodError: undefined method '[]' for nil:NilClass. This means that you are using square bracket notation to read a property from an object, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found