-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Description
firebase deploy --only functions fails with a 403 error on the Firebase Extensions API (firebaseextensions.googleapis.com) even when the project uses zero extensions.
Steps to Reproduce
- Create a Firebase project with Cloud Functions (2nd gen, Node 22) and no extensions
- Ensure
firebase.jsonhas noextensionskey - Ensure no code imports from
firebase-functions/extensions - Run
firebase deploy --only functions
Expected Behavior
Deploy succeeds — extensions check is skipped when no extensions are defined.
Actual Behavior
i extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
Error: Request to https://firebaseextensions.googleapis.com/v1beta/projects/<project>/instances?pageSize=100&pageToken= had HTTP Error: 403, The caller does not have permission
Root Cause
In lib/deploy/functions/prepare.js line 70:
if (Object.values(wantBuilds).some((b) => b.extensions)) {The firebase-functions SDK runtime loader always includes an extensions key in the build output — even when no extensions are defined, it returns extensions: {}. Since {} is truthy in JavaScript, the check passes and prepareDynamicExtensions is called, which then hits listInstances on the Extensions API.
Fix
Change the check to also verify the extensions object is non-empty:
if (Object.values(wantBuilds).some((b) => b.extensions && Object.keys(b.extensions).length > 0)) {Environment
- Firebase CLI: 15.8.0 (also reproduced on 13.x and 14.x)
- firebase-functions: ^6.3.0
- Node: 22
- OS: macOS (Darwin 25.2.0)
Reactions are currently unavailable