Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firebase deploy skips exported function

I recently added a new cloud function to my project, and for some reason when I deploy it gets skipped:

firebase deploy --only functions:stripeOperation

which results in

⚠ functions: the following filters were specified but do not match any functions in the project: stripeOperation

The file structure is like this:

functions/
├── src/
│   ├── stripe
│   │    ├── index.ts
│   │    ├── myTrigger.ts
│   │    ├── anotherTrigger.ts
│   │    └── stripeOperation.ts
│   ├── index.ts

functions/src/stripe/index exports all 3 of the functions in the stripe folder. functions/src/index exports them from the stripe folder:

export { stripeOperation, myTrigger, anotherTrigger } from './stripe';

Here's where it gets weird - myTrigger and anotherTrigger successfully deploy, but stripeOperation doesn't. There are no build errors. Firebase isn't giving me any clues as to why it's skipped. I checked and the transpiled code looks fine. stripeOperation is a callable function but the other 2 are firestore triggers. This is the signature of stripeOperation:

export const stripeOperation = functions.https.onCall((data, context) => {
  ...
});

Is there any way to determine why firebase won't deploy my function? I am using "firebase-functions": "^2.3.1"

Update: I have tried renaming the function, and completely switching out the function body with a previously deployed function, and neither worked.

like image 608
inorganik Avatar asked Mar 05 '26 17:03

inorganik


1 Answers

You have to export callable functions separately from trigger functions. This doesn't make sense, so I filed an issue.

functions/src/index:

export { stripeOperation } from './stripe/stripeOperation';
export { myTrigger, anotherTrigger } from './stripe';
like image 115
inorganik Avatar answered Mar 08 '26 14:03

inorganik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!