I'm trying to add a serviceAccountKey to my cloud functions project (Typescript)
var serviceAccount = require("/Users/kareldebedts/myAppName/functions/serviceAccountKeyName.json");
admin.initializeApp({
storageBucket: "appName.appspot.com",
credential: admin.credential.cert(serviceAccount),
});
When I deploy my functions I get this error:
Deployment error.
Function failed on loading user code. Error message: Code in file lib/index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module '/Users/kareldebedts/myAppName/functions/serviceAccountKeyName.json'
What Am I doing wrong? Because if i cmd click on the path it opens the file, so the path exists.