Repository navigation
Closed
Description
[REQUIRED] Environment info
firebase-tools: 14.2.2 through 14.6.0 (latest as of this writing)
Platform: macOS
[REQUIRED] Test case
This used to work for running the stripe extension emulator:
GOOGLE_APPLICATION_CREDENTIALS=$(realpath service-account.json) firebase emulators:start --only=auth,firestore,functions,extensions --project=demo-x
More recently, it's been failing with the following error:
Error: Errors while reading 'extensions' in 'firebase.json'
- Unable to refresh auth: not yet authenticated.
It looks like GOOGLE_APPLICATION_CREDENTIALS is being ignored; only firebase login works.
[REQUIRED] Steps to reproduce
- Create a blank project with these files:
echo '{
"emulators": {
"functions": { },
"firestore": { },
"auth": { }
},
"extensions": {
"stripe": "invertase/[email protected]"
}
}' > firebase.json
mkdir extensions
touch extensions/stripe.env
touch extensions/stripe.secret.local- Add a dummy GCP service account key at
service-account.json - Make sure you have firebase-tools v14.2.2 or later
- Run
GOOGLE_APPLICATION_CREDENTIALS=$(realpath service-account.json) firebase emulators:start --only=auth,firestore,functions,extensions --project=demo-x
[REQUIRED] Expected behavior
Output from v14.1:
⚠ functions: The functions emulator is configured but there is no functions source directory. Have you run firebase init functions?
i emulators: Starting emulators: auth, functions, firestore, extensions
i emulators: Detected demo project ID "demo-x", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail.
⚠ Function 'createPortalLink' is missing a trigger in extension.yaml. Please add one, as triggers defined in code are ignored.
⚠ Function 'handleWebhookEvents' is missing a trigger in extension.yaml. Please add one, as triggers defined in code are ignored.
⚠ functions: The functions emulator is configured but there is no functions source directory. Have you run firebase init functions?
⚠ functions: Application Default Credentials detected. Non-emulated services will access production using these credentials. Be careful!
⚠ firestore: Cloud Firestore Emulator does not support multiple databases yet.
⚠ firestore: Did not find a Cloud Firestore rules file specified in a firebase.json config file.
⚠ firestore: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.
i firestore: Firestore Emulator logging to firestore-debug.log
✔ firestore: Firestore Emulator UI websocket is running on 9150.
i functions: Watching "/Users/anton/.cache/firebase/extensions/invertase/[email protected]/functions" for Cloud Functions...
✔ functions: Loaded functions definitions from source: createCustomer, createCheckoutSession, createPortalLink, handleWebhookEvents, onUserDeleted, onCustomerDataDeleted.
✔ functions[${LOCATION}-ext-stripe-createCustomer]: auth function initialized.
✔ functions[${LOCATION}-ext-stripe-createCheckoutSession]: firestore function initialized.
✔ functions[${LOCATION}-ext-stripe-createPortalLink]: http function initialized (http://127.0.0.1:5001/demo-x/$%7BLOCATION%7D/ext-stripe-createPortalLink).
✔ functions[${LOCATION}-ext-stripe-handleWebhookEvents]: http function initialized (http://127.0.0.1:5001/demo-x/$%7BLOCATION%7D/ext-stripe-handleWebhookEvents).
✔ functions[${LOCATION}-ext-stripe-onUserDeleted]: auth function initialized.
✔ functions[${LOCATION}-ext-stripe-onCustomerDataDeleted]: firestore function initialized.
Notably, this line of the output suggests that GOOGLE_APPLICATION_CREDENTIALS are being picked up correctly:
⚠ functions: Application Default Credentials detected. Non-emulated services will access production using these credentials. Be careful!
[REQUIRED] Actual behavior
Here's output from v14.6, with --debug turned on:
[2025-06-06T19:52:43.204Z] Object "/extensions" in "firebase.json" has unknown property: {"additionalProperty":"stripe"}
⚠ functions: The functions emulator is configured but there is no functions source directory. Have you run firebase init functions? {"metadata":{"emulator":{"name":"functions"},"message":"The functions emulator is configured but there is no functions source directory. Have you run \u001b[1mfirebase init functions\u001b[22m?"}}
[2025-06-06T19:52:43.302Z] openjdk version "23.0.2" 2025-01-21
[2025-06-06T19:52:43.302Z] OpenJDK Runtime Environment Homebrew (build 23.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 23.0.2, mixed mode, sharing)
[2025-06-06T19:52:43.307Z] Parsed Java major version: 23
i emulators: Starting emulators: auth, functions, firestore, extensions {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: auth, functions, firestore, extensions"}}
i emulators: Detected demo project ID "demo-x", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail. {"metadata":{"emulator":{"name":"hub"},"message":"Detected demo project ID \"demo-x\", emulated services will use a demo configuration and attempts to access non-emulated services for this project will fail."}}
[2025-06-06T19:52:43.309Z] Successfully read params from stripe.env
[2025-06-06T19:52:43.309Z] Error: ENOENT: no such file or directory, open '/Users/anton/src/firebase-tmp/extensions/stripe.env.0'
[2025-06-06T19:52:43.309Z] Error: ENOENT: no such file or directory, open '/Users/anton/src/firebase-tmp/extensions/stripe.env.demo-x'
[2025-06-06T19:52:43.309Z] Error: ENOENT: no such file or directory, open '/Users/anton/src/firebase-tmp/extensions/stripe.env.local'
[2025-06-06T19:52:43.310Z] No OAuth tokens found
[2025-06-06T19:52:43.310Z] No OAuth tokens found
[2025-06-06T19:52:43.310Z] Got error reading extensions entry stripe (invertase/[email protected]): Unable to refresh auth: not yet authenticated.
[2025-06-06T19:52:43.321Z] Could not find VSCode notification endpoint: FetchError: request to http://localhost:40001/vscode/notify failed, reason: . If you are not running the Firebase Data Connect VSCode extension, this is expected and not an issue.
i emulators: Shutting down emulators. {"metadata":{"emulator":{"name":"hub"},"message":"Shutting down emulators."}}
[2025-06-06T19:52:43.323Z] Could not find VSCode notification endpoint: FetchError: request to http://localhost:40001/vscode/notify failed, reason: . If you are not running the Firebase Data Connect VSCode extension, this is expected and not an issue.
Error: Errors while reading 'extensions' in 'firebase.json'
- Unable to refresh auth: not yet authenticated.
Having trouble? Try firebase [command] --help
Activity
aalej commentedon Jun 9, 2025
Hey @staticshock, thanks for creating a detailed report! I really appreciate this. I’m able to reproduce the error you mentioned. Though, from what I can gather the issue starts occurring in
firebase-toolsv14.2.2 or later. Just to verify, are you encountering this issue when using 14.2.0 or 14.2.1?I’ll raise this to our engineering team and mark this as reproducible. Sharing the mcve here.
staticshock commentedon Jun 9, 2025
You're totally right; v14.2.1 is the last working version, and v14.2.2 is the first broken one. I've updated my original message to be more specific.
[-]extensions emulator (>=v14.2) ignores GOOGLE_APPLICATION_CREDENTIALS[/-][+]extensions emulator (>=v14.2.2) ignores GOOGLE_APPLICATION_CREDENTIALS[/+]