Error when deploying Firebase function

1,543 views
Skip to first unread message

ant...@castamash.com

unread,
Mar 12, 2017, 11:36:47 AM3/12/17
to Firebase Google Group
Hi there,

I installed the functions package in my firebase iOS app project and had the proper functions project structure as expected. 

I am following the guide to "Create and Deploy Your First Cloud Functions" and when typing the

$ firebase deploy --only functions

command, I get the following in the console. Why am I getting this error? I am on the Spark plan, is this the cause?

 deploying functions

 functions: ensuring necessary APIs are enabled...

 runtimeconfig: ensuring necessary APIs are enabled...

✔  runtimeconfig: all necessary APIs are enabled

✔  functions: all necessary APIs are enabled

 functions: preparing functions directory for uploading...


Error: Error occurred while parsing your function triggers.


/private/var/folders/n3/gm3x7vhd01vc03k2vzw98s380000gn/T/fbfn_13931BfydZwxejxME/index.js:3

admin.initializeApp(function.config().firebase);

                            ^

SyntaxError: Unexpected token .

    at createScript (vm.js:53:10)

    at Object.runInThisContext (vm.js:95:10)

    at Module._compile (module.js:543:28)

    at Object.Module._extensions..js (module.js:580:10)

    at Module.load (module.js:488:32)

    at tryModuleLoad (module.js:447:12)

    at Function.Module._load (module.js:439:3)

    at Module.require (module.js:498:17)

    at require (internal/module.js:20:19)

    at Object.<anonymous> (/usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:16:9)

Brian Woodward

unread,
Mar 12, 2017, 1:06:29 PM3/12/17
to fireba...@googlegroups.com
Looks like you have a typo in your code.

admin.initializeApp(function.config().firebase);

should be

admin.initializeApp(functions.config().firebase);

You're missing the 's' on 'function'.

- Brian

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b443b39c-a1f3-4582-9009-4eb1c2025c56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages