Firebase: include GOOGLE_APPLICATION_CREDENTIALS json file in bundle

I decided to simplify by removing netlify-lambda and webpack from my build process. This means I have a single functions folder with my .js and .json files. I changed my netlify.toml file to direct it to /functions, not /function-build. I run netlify deploy and it deploys okay. Still getting this error though:

{"errorType":"Error","errorMessage":"The file at ./pgnfen2-0dcc7c57af09.json does not exist, or it is not a file.

Okay, so @futuregerald suggested I try the zip-it-and-ship-it utility. I added the module, created a utility script as shown in the docs:

 const { zipFunctions } = require('@netlify/zip-it-and-ship-it')

zipFunctions('functions', 'functions-dist').catch(e => { throw e })

(Note, this script will throw an exception if the function-dist folder does not already exist)

What I seeis this:

image

The destination folder does not have a zip version of the JSON file from the original function folder. Now if I deploy (after changing the .toml file to point to the functions-dist folder), I get the exact same error as before:

{“errorType”:“Error”,“errorMessage”:"The file at ./pgnfen2-0dcc7c57af09.json does not exist, or it is not a file.

Since netlify-lambda uses the zip-it package, I wonder if it is related?

I know there is a programatic way to validate the Google credentials using an API, so maybe that is what I’ll be forced to do.