Hi Tom, for some reason, when I import firebase with {firebaseConfig as firebaseConfig} I get
RuntimeError: window.firebase.initializeApp is not a function
I guess is due to the fact that you need firebaseConfig value to initiate firebase , if (!window.firebases[firebaseConfig.appId])
The solution right now is to not import the firebase cell from here but redefine it on my notebook. I didn't have much time to look, but there must be a better way to initialize the library.
Thanks
Yes for sure, I have my own firebaseConfig cell. it's nuts I just created another fresh notebook with just the import and the firebaseConfig and it works, however the other notebook I'm working on doesn't, I'm wondering if its some import caching issue on observable. I often get Cloudflare DDNS errors as I keep hard refreshing and cleaning the cookies
oh my, found the problem, you won't believe! I had a markdown cell named #### Firebase that generates <h4 id="firebase">Firebase Init</h4> and as you might now, any element id is on the global window scope,
https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
window.firebase now is a reference to that h4 element , you check for if (!window.firebase) and boom :) thanks and sorry for the confusion
actually I had to water it down a bit. I deliberately had it in global scope as thats how firebase-ui boots itself :'(
By default it's now on window._firebase
But if you use firebase-ui then it assigns window.firebase SDK, as it's a necessary evil there.
hi Tom, what would make sense to have as an unresolved promise for user value? I'm currently using it for a project and it would be nice to have a null or false state when the user is not logged, thus you can present a state warning that you still need to log in, or for instance disable charts and other element that depend upon login and fetching data. This issue reminded me of the LocalFile and the solution was to set a default value open to the user but not an unresolved promised. do you remember? thanks