-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6.0.1 functions.runWith is not a function #1616
Comments
I found a few problems with this issue:
|
There has been (what I consider to be an undocumented) breaking change in firebase-functions. You now need to specify V1 on your import see #1614 |
In case of use to anyone else who comes across this thread (like me!), I found the migration docs from v1 to v2 and so no longer use runWith() to pass in secrets.
So I don't need the runWith() function - its now the first argument to the v2 onRequest() function. |
Thank you, @alankent For me, it was outside of my function at the bottom of my code, I had declared my runWith params, which seemingly no longer works. Old code:
Newcode:
|
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"
});
[REQUIRED] Expected behavior
[REQUIRED] Actual behavior
TypeError: functions.runWith is not a function
Were you able to successfully deploy your functions?
The text was updated successfully, but these errors were encountered: