I am trying to import Google Storage node.js module into my Firebase Cloud functions. I am using TypeScript.
//myfile.ts
import { Storage } from '@google-cloud/storage';
const storageInstance = new Storage({
projectId: firebaseProjectId,
keyFilename: "../service_accounts/" + firebaseProjectId + ".json"
});
export const bucket = storageInstance.bucket(firebaseProjectId + '.appspot.com');
When running $firebase deploy
, I get:
TypeError: storage_1.Storage is not a constructor
Inside /lib/myfile.js