mdanics/fluttergram

firebase deploy issues

jnash766 opened this issue · 3 comments

I'm very new to firebase and trying to work through the setup. I ran into an issue I can't seem to get past. I apologize in advance, I'm sure this must be something dumb I'm missing.

When doing this step:
Push the function getFeed with firebase deploy --only functions In the output, you'll see the getFeed URL, copy that.

I get the following error:
John-iMac lib % firebase deploy --only functions
⚠ functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions@latest in your functions directory.

=== Deploying to 'fluttergram-xxxxx'...

i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

functions@ lint /Users/John/Desktop/Coding/Flutter/fluttergram/functions/functions
tslint --project tsconfig.json

Running command: npm --prefix "$RESOURCE_DIR" run build

functions@ build /Users/John/Desktop/Coding/Flutter/fluttergram/functions/functions
tsc

src/index.ts:1:1 - error TS6133: 'functions' is declared but its value is never read.

1 import * as functions from 'firebase-functions';



Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Not sure if this is ok, but I found where other firebase projects were having this same error. They were able to resolve it by editing the tsconfig.json and changing the following:

"noUnusedLocals": true, <-- change this to: false

I did this and I no longer get an error, but I also don't see "getFeed URL" in the output. Any ideas if thats ok to change that variable and if where I would find the getFeed URL? I'm guessing the project console URL is not what I'm looking for?

John@John-iMac functions % firebase deploy --only functions

=== Deploying to 'fluttergram-xxxx'...

i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

functions@ lint /Users/John/Desktop/Coding/fluttergram/functions/functions
tslint --project tsconfig.json

Running command: npm --prefix "$RESOURCE_DIR" run build

functions@ build /Users/John/Desktop/Coding/fluttergram/functions/functions
tsc

✔ functions: Finished running predeploy script.
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing functions directory for uploading...

✔ Deploy complete!

Project Console: https://console.firebase.google.com/project/fluttergram-xxxx/overview
John@John-iMac functions %

The error that you provided says:

Please upgrade using npm install --save firebase-functions@latest in your functions directory.

Did you try running npm install --save firebase-functions@latest?

Closing for inactivity