Firebase 3 overrides global Node promise :(

182 views
Skip to first unread message

Daniel Steigerwald

unread,
May 23, 2016, 11:46:02 AM5/23/16
to Firebase Google Group
So after several hours of hard debugging, I finally found why bluebird promises don't work in https://github.com/este/este.

Whenever I import firebase 3, it overrides global Node promise. Maybe it's some race condition in configuration, but Firebase 2 worked well.

Nor having a public issue tracker is huge PITA for all Firebase developers. I love Firebase but simply don't understand why not having one? Why?
It's requested literally for years with no clear answer :-(


Kato Richardson

unread,
May 23, 2016, 12:10:01 PM5/23/16
to Firebase Google Group
Daniel,

Please submit a minimal repro to support. Happy to file a bug and get the promise issues resolved.

Have a great day,
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/314cfc63-e088-4e93-9f25-00d2e76a15b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

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

Daniel Steigerwald

unread,
May 23, 2016, 12:47:50 PM5/23/16
to Firebase Google Group
I tried but github is down for me right now. Nevermind, it's super easy to reproduce it.
Last Node 5, package.json has only firebase as dependency, and this is index.js file:

require('firebase');

// When firebase is not required, it logs: [Function: Promise]
// When firebase is required, it logs: [Function: lib$es6$promise$promise$$Promise]
console.log(Promise);

Having it here means we can discuss it and community can even fix it for you for free, which is quite impossible with "support form" support.

I think the problem is here: node_modules/firebase/node_modules/es6-promise/lib/es6-promise/polyfill.js
This line: if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {

I could even send PR, but for some unknown reason, I can't.

Btw, I would highly recommend using Bluebird instead. https://github.com/petkaantonov/bluebird/blob/master/docs/docs/why-bluebird.md

Kato Richardson

unread,
May 23, 2016, 12:52:54 PM5/23/16
to Firebase Google Group
Daniel,

If you want this fixed, you need to submit it via the correct channels, so we can get it escalated to the engineers. Please send a report in through support. Feel free to continue discussing potential solutions here and to reference this thread in the report.

Note that it will also help others, since we can add it to the known issues, after we reproduce and verify.

Thanks,
Kato


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

Daniel Steigerwald

unread,
May 23, 2016, 1:49:33 PM5/23/16
to Firebase Google Group
Sorry, but I just lost interest since someone deleted my message without any explanation and not having a public issue tracker is not acceptable for any open source.
I will work around it somehow. I have time only for regular Github PR workflow.
I hope you understand.

Jacob Wenger

unread,
May 23, 2016, 5:38:47 PM5/23/16
to Firebase Google Group
Gahh sorry for this one, Daniel. We realized very shortly before release that we were breaking Node 0.10 support and we unsuccessfully tried to polyfill the native Promise, but apparently did a poor job at that. We should definitely not be overriding the global Node Promise. We've got an engineer working on fixing this and we will cut a new release ASAP.

Jacob

Daniel Steigerwald

unread,
May 23, 2016, 6:56:24 PM5/23/16
to Firebase Google Group
The fix is easy. Use bluebirdjs directly, do not polyfill anything. It's library.

Jacob Wenger

unread,
May 27, 2016, 10:38:08 PM5/27/16
to fireba...@googlegroups.com
Note that this is fixed in version 3.0.3 of the Firebase Node.js SDK.

Reply all
Reply to author
Forward
0 new messages