Within my TypeScript file, the following code is present:
import * as admin from 'firebase-admin'
import * as functions from 'firebase-functions'
const serviceAccountKey = "serviceAccountKey.json"
const databaseURL = "https://blahblah.firebaseio.com"
admin.initializeApp({
credential: admin.credential.cert(serviceAccountKey),
databaseURL: databaseURL
});
While testing in the emulator, everything runs smoothly. However, when attempting to deploy, an error surfaces:
Error: An issue arose while parsing function triggers.
Error: Failed to parse certificate key file: Error: ENOENT: no such file or directory, open 'serviceAccountKey.json'
I've experimented with relocating the json file to various directories, including the root folder and the lib folder where index.js resides, but to no avail. How can I successfully pass the key during deployment?