Skip to content

6.0.0 Property 'region' does not exist on type 'typeof import #1614

@davie-robertson

Description

@davie-robertson

Related issues

No - checked ChangeLog too

[REQUIRED] Version info

upgrade from ^5.1.1 to ^6.0.0

node:

v20.15.0

firebase-functions:
^6.0.0

firebase-tools:

13.17.0

firebase-admin:

[REQUIRED] Test case

all my cloud functions were setup to run in region region("europe-west1")

I did a firebase deploy --only functions and saw the prompt to npm install --save firebase-functions@latest

I then redeployed my cloud functions and got errors in two cloud functions stating that:

error TS2339: Property 'region' does not exist on type 'typeof import("/home/user/development/app/functions/node_modules/firebase-functions/lib/v2/index")'

[REQUIRED] Steps to reproduce

// This function will be triggered when a user is deleted
// It will delete the user document from the database and all relationships where the user is following others
import {UserRecord} from "firebase-admin/auth";
import {getFirestore} from "firebase-admin/firestore";
import * as functions from "firebase-functions";
import * as logger from "firebase-functions/logger";

export const deleteUserDocument = functions
  .region("europe-west1")
  .auth.user()
  .onDelete(async (user: UserRecord) => {
    const db = getFirestore();
    const userRef = db.collection("users").doc(user.uid);

    try {...}

[REQUIRED] Expected behavior

It should deploy in the same way as previously

[REQUIRED] Actual behavior

error on deployment

Were you able to successfully deploy your functions?

not since upgrading to 6.0.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions