From dce72c6343e454dee7775c77964153d19bfe1a14 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 29 Oct 2025 18:54:11 -0700 Subject: [PATCH 1/2] BREAKING: Break TS build that uses functions.config() --- spec/v1/config.spec.ts | 7 +++++-- src/v1/config.ts | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/spec/v1/config.spec.ts b/spec/v1/config.spec.ts index 45d51f09c..764e1a05b 100644 --- a/spec/v1/config.spec.ts +++ b/spec/v1/config.spec.ts @@ -26,11 +26,14 @@ import { config } from "../../src/v1/config"; describe("config()", () => { it("throws an error with migration guidance", () => { - expect(config).to.throw( + expect(() => { + // @ts-expect-error - config is deprecated and typed as never to cause a build error + config(); + }).to.throw( Error, "functions.config() has been removed in firebase-functions v7. " + "Migrate to environment parameters using the params module. " + "Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config" ); }); -}); +}); \ No newline at end of file diff --git a/src/v1/config.ts b/src/v1/config.ts index 6b1522f33..7676f2870 100644 --- a/src/v1/config.ts +++ b/src/v1/config.ts @@ -27,10 +27,10 @@ export { firebaseConfig } from "../common/config"; * Migrate to environment parameters using the `params` module immediately. * Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config */ -export function config(): Record { +export const config: never = (() => { throw new Error( "functions.config() has been removed in firebase-functions v7. " + "Migrate to environment parameters using the params module. " + "Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config" ); -} +}) as unknown as never; \ No newline at end of file From 7d7a3bde68672081b0c0de1e5c378d81a99c5cd3 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Thu, 30 Oct 2025 09:50:39 -0700 Subject: [PATCH 2/2] Simplify as never cast. --- src/v1/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v1/config.ts b/src/v1/config.ts index 7676f2870..b50ce7b31 100644 --- a/src/v1/config.ts +++ b/src/v1/config.ts @@ -33,4 +33,4 @@ export const config: never = (() => { "Migrate to environment parameters using the params module. " + "Migration guide: https://firebase.google.com/docs/functions/config-env#migrate-config" ); -}) as unknown as never; \ No newline at end of file +}) as never;