Where do we file bugs w/ 3.0?

1,617 views
Skip to first unread message

David Ascher

unread,
May 20, 2016, 11:54:20 PM5/20/16
to Firebase Google Group
If you don't use github that's fine, but at least have a bug tracker somewhere?

node using firebase 3.0.2

> require('firebase/app')
ReferenceError: firebase is not defined

even though the npm docs (https://www.npmjs.com/package/firebase) suggest that is in fact the recommended usage.

and this usage:

var config = {
  apiKey: "<secret>",
  authDomain: "blah.firebaseapp.com",
  databaseURL: "https://blah.firebaseio.com",
  storageBucket: "blah.appspot.com",
};
var fb = firebase.initializeApp(config);

yields:

    throw new Error('Invalid service account provided');
    ^
Error: Invalid service account provided
    at new Auth (/Users/dascher1/src/participedia/pp3/node_modules/firebase/auth-node/auth.js:61:11)
    at Object.serviceFactory [as auth] (/Users/dascher1/src/participedia/pp3/node_modules/firebase/auth-node/index.js:14:14)
    at F.u (/Users/dascher1/src/participedia/pp3/node_modules/firebase/app-node.js:14:94)
    at /Users/dascher1/src/participedia/pp3/node_modules/firebase/auth-node/index.js:31:9
    at /Users/dascher1/src/participedia/pp3/node_modules/firebase/app-node.js:11:272
    at Array.forEach (native)
    at Object.e.initializeApp (/Users/dascher1/src/participedia/pp3/node_modules/firebase/app-node.js:11:245)
    at Object.<anonymous> (/Users/dascher1/src/participedia/pp3/algolia.js:14:19)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)


looking at the auth-node code (which thankfully isn't obfuscated), it seems to assume that I need an authorized connection, even if my firebase is configured to allow anonymous reads.

Kato Richardson

unread,
May 21, 2016, 12:42:20 AM5/21/16
to Firebase Google Group
Hi David,

Please file bugs at the support page. Be sure you include a working, minimal repro they can run to verify, and steps to reproduce.

☼, Kato

--
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-tal...@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/6e7b8bfd-c60e-410e-829d-965006b03aa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Jared Gholston

unread,
May 21, 2016, 12:38:25 PM5/21/16
to Firebase Google Group
Seeing the same error using Webpack with Firebase 3.0.2

const firebase = require('firebase');
const firebaseConfig = {
apiKey: "<key>",
authDomain: "<domain",
databaseURL: "<dburl>",
storageBucket: "<bucket>"
};

firebase.initializeApp(firebaseConfig);


Error: Invalid service account provided

    at new Auth (/Users/jarbot2/Documents/git/blackbook/node_modules/firebase/auth-node/auth.js:61:11)

Daniel Steigerwald

unread,
May 21, 2016, 6:59:28 PM5/21/16
to Firebase Google Group
Firebase 3 isn't isomorphic anymore for some reason, you have to use https://firebase.google.com/docs/database/server/start#server-sdk-authentication
That's sucks because we have to hard code some sensitive things even for reading public data.

Kato Richardson

unread,
May 23, 2016, 10:07:55 AM5/23/16
to Firebase Google Group
Daniel, you already posted this in another thread and it is unrelated to the topic of this one. Please respect other people's time and energy and restrain your posts to once, in the best practical location.

--
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-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Boris van Hoytema

unread,
May 23, 2016, 11:32:17 AM5/23/16
to Firebase Google Group
Daniel's email actually helped me find out what was happening, you need different credentials to log in with a server.

Since the server and the frontend can't use the same code anymore, and need to download a JSON file containing them,

Rob Christian

unread,
May 23, 2016, 10:29:28 PM5/23/16
to Firebase Google Group
Daniel's and Boris's replies were helpful to me as well. I'm seeing this on node.js.

Boris van Hoytema

unread,
May 24, 2016, 2:30:18 AM5/24/16
to Firebase Google Group
So here is how I've solved this problem + not uploading the sensitive data in my repo (for CI):

1. Use the Firebase sever SDK from https://firebase.google.com/docs/database/server/start#server-sdk-authentication
2. Make the JSON document from the Permissions settings page in the console
3. Base64 encoded the JSON document and entered the encoded string on the environment variables of my CI
4. Decode Base64 in my script to use as the authentication data

Perhaps there can be a guide on this somewhere on the Firebase site

AKHEEL K M

unread,
May 24, 2016, 10:28:58 AM5/24/16
to Firebase Google Group
Where do I download that JSON file from?

Jacob Wenger

unread,
Jun 8, 2016, 2:26:26 AM6/8/16
to fireba...@googlegroups.com
Just to follow up on some of the things discussed here:

@Boris - Encoding / decoding the JSON payload is unfortunately not going to work very well since anyone can decode the JSON file and you are not actually encrypting the payload. If you are using Travis for your CI, you can make use of their encryption keys feature. You can see an example of how we've done this here.

@AKHEEL K M - You can download the JSON file via the instructions documented here.

@all - The browser SDK (which is used with webpack) is initialized with an apiKey, authDomain, databaseURL, etc. while the Node.js SDK is initialized with a service account. Also, using things like require('firebase/app') to reduce bundle size only works on the browser since in Node.js you don't have any reason to reduce bundle size. With that out of the way, there have been many discussions both internally and externally which make it clear that the 3.x.x SDKs do not solve all of developers' use cases and requiring a service account for Node.js is not ideal. We conflated Node.js usage with "admin" usage and that was not the right decision. We are putting together some updates here in the coming weeks, so please keep an eye out for those. For the time being, if you are blocked by anything, please continue to use the 2.x.x SDKs which will continue to work for a long time.

Reply all
Reply to author
Forward
0 new messages