Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed an issue where functions deployment would fail if `firebase.json#extensions` was undefined. (#7575)
10 changes: 8 additions & 2 deletions src/deploy/extensions/planner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ export async function have(projectId: string): Promise<DeploymentInstanceSpec[]>
* any extensions the user has defined that way.
* @param args.projectId The project we are deploying to
* @param args.projectNumber The project number we are deploying to.
* @param args.extensions The extensions section of firebase.jsonm
* @param args.extensions The extensions section of firebase.json
* @param args.emulatorMode Whether the output will be used by the Extensions emulator.
* If true, this will check {instanceId}.env.local for params a
* If true, this will check {instanceId}.env.local for params
*/
export async function wantDynamic(args: {
projectId: string;
Expand All @@ -143,6 +143,9 @@ export async function wantDynamic(args: {
}): Promise<DeploymentInstanceSpec[]> {
const instanceSpecs: DeploymentInstanceSpec[] = [];
const errors: FirebaseError[] = [];
if (!args.extensions) {
return [];
}
for (const [instanceId, ext] of Object.entries(args.extensions)) {
const autoPopulatedParams = await getFirebaseProjectParams(args.projectId, args.emulatorMode);
const subbedParams = substituteParams(ext.params, autoPopulatedParams);
Expand Down Expand Up @@ -207,6 +210,9 @@ export async function want(args: {
}): Promise<DeploymentInstanceSpec[]> {
const instanceSpecs: DeploymentInstanceSpec[] = [];
const errors: FirebaseError[] = [];
if (!args.extensions) {
return [];
}
for (const e of Object.entries(args.extensions)) {
try {
const instanceId = e[0];
Expand Down
4 changes: 2 additions & 2 deletions src/deploy/extensions/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export async function prepareDynamicExtensions(
projectNumber,
aliases,
projectDir,
extensions: options.config.get("extensions"),
extensions: options.config.get("extensions", {}),
});
noDeleteExtensions = noDeleteExtensions.concat(firebaseJsonWant);
if (hasNonDeployingCodebases(options)) {
Expand Down Expand Up @@ -242,7 +242,7 @@ export async function prepare(context: Context, options: Options, payload: Paylo
projectNumber,
aliases,
projectDir,
extensions: options.config.get("extensions"),
extensions: options.config.get("extensions", {}),
});
const dynamicWant = await planner.wantDynamic({
projectId,
Expand Down