I'm trying to run a github action workflow which start firebase emulators,
It seems that for some reason the functions emulator fails to parse the .runtimeconfig.json
,I verified that it exits and valid.
Here is the error:
functions: Failed to load function definition from source: FirebaseError: Failed to load function definition from source: Failed to generate manifest from function source: TypeError: Cannot read properties of undefined (reading 'key')
Here is an example of a .runtimeconfig.json:
{
"coockie": {
"key": "SOME_STRING"
},
"field": {
"list": [
"SOME_STRING"
]
},
}
Here are some relevant steps from my workflow:
jobs:
run-job:
runs-on: ubuntu-latest
steps:
- name: Checkout_Workflows
uses: actions/checkout@v2
- name: Set up Node.js 16
uses: actions/setup-node@v1
with:
node-version: 16.15.0
- name: npm install -g firebase-tools-10.9.2
run: npm install -g firebase-tools@10.9.2
- name: npm install -g typescript-4.7.4
run: npm install -g typescript@4.7.4
- name: npm install firebase-functions
run: cd firebase/cloud-functions && npm install
- name: deploy serve & and run PlayWright
run: npm run start:emulator
shell: bash
env:
PROJECT_ID: MY_PROJRCT_ID
FIREBASE_TOKEN: MY_FIREBASE_TOKEN
The NPM command do the following:
"start:emulator": "cd firebase/cloud-functions; npm run start:automation"
"start:automation": "CLOUD_RUNTIME_CONFIG=/home/runner/work/uvcamp/uvcamp/firebase/cloud-functions/.runtimeconfig.json firebase use dev && firebase functions:config:get > .runtimeconfig.json && firebase emulators:exec --import=./emulator-data --only=auth,firestore,functions,storage \"npm run start:playwright-test\"",
I ran the same project locally and it worked find with no problems, including the script in npm run start:playwright-test
I tried setting an environment variable CLOUD_RUNTIME_CONFIG
with the absolute path and to downgrade version of:
- firebase-tools to 10.9.2
- typescript to 4.7.4
and still got the same error.
any thought on what can be the issue?
thank!