Skip to content

6.0.1 functions.runWith is not a function #1616

@joalzamora

Description

@joalzamora

Related issues

[REQUIRED] Version info

upgrade from ^5.1.1 to ^6.0.1

node:

20

firebase-functions:
^6.0.1

firebase-tools:
13.15.2

13.5.2

firebase-admin:
^11.8.0

[REQUIRED] Test case

[REQUIRED] Steps to reproduce

Execute the following command npm install --save firebase-functions@latest

and when I run the code I get the following error

TypeError: functions.runWith is not a function

A sample code is:

const functions = require('firebase-functions');

exports.newAccount = functions
.runWith({
memory: '256MB',
maxInstances: 1,
})
.auth.user().onCreate(async (user) => {
const email = user.email;
const subject = "Welcome"

    try {
        console.log("A new user account has been created")
    	await sendWelcome(email,subject);
    } catch (error) {
    	console.error('Error sending email:', error.message);
    }

});

[REQUIRED] Expected behavior

[REQUIRED] Actual behavior

TypeError: functions.runWith is not a function

Were you able to successfully deploy your functions?

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