I Figure it out.
The problem was with this lines:
const RAPIDAPI_KEY = process.env.RAPIDAPI_KEY || functions.config().rapidapi.key;
const RAPIDAPI_HOST = process.env.RAPIDAPI_HOST || functions.config().rapidapi.host;
The command:
function.config()
is no longer available in Google Cloud.
instead, need to using secrets and using it like this:
the cosnsts are inside the exports and not outside like before.
exports.importFixtures = onSchedule(
{
schedule: "0 2 * * *",
timeZone: "Asia/Jerusalem",
region: "europe-west1",
secrets: ["RAPIDAPI_KEY", "RAPIDAPI_HOST"],
},
async (event) => {
const RAPIDAPI_KEY = process.env.RAPIDAPI_KEY
const RAPIDAPI_HOST = process.env.RAPIDAPI_HOST