Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase functions deployment not updating

I have my firebase functions set up across multiple files. For some reason when i deploy the changes are not being applied as though they are cached or something.

My folder structure is as follows:

functions/

scr/

index.ts
auth.ts
inventory.ts

Here is my index.ts:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const functions = require("firebase-functions");
const admin = require("firebase-admin");
exports.auth = require("./auth");
exports.inventory = require("./inventory");
admin.initializeApp();

auth.ts:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const auth_functions = require("firebase-functions");
exports.login = auth_functions.https.onRequest(
  (request: any, response: any) => {
    response.send("login");
  }
);

exports.logout = auth_functions.https.onRequest(
  (request: any, response: any) => {
    response.send("logout");
  }
);

inventory.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const inventory_functions = require("firebase-functions");
exports.getByLocation = inventory_functions.https.onRequest(
  async (request: any, response: any) => {
  response.send("inventory");
});

After i run

firebase deploy --only functions

Everything shows successful but i am not seeing changes in emulator or when i deploy. I also tried renaming/removing a function and the cli ignored it and just shows success. This is very frustrating considering logs tell me nothing and no error occurs.

like image 369
Maxqueue Avatar asked Apr 23 '26 01:04

Maxqueue


1 Answers

Problem was in my package.json where path was wrong to index.js. Basically was building to a directory that was different then where i was deploying from. Just needed to update to

"main": "lib/index.js",
like image 147
Maxqueue Avatar answered Apr 24 '26 15:04

Maxqueue



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!