Super basic Firebase error, "Firebase is not defined" - firebase

I'm making the move into Firebase. But Day One I'm stumped with a simple one liner.
This is right from the demo:
var myDataRef = new Firebase('https://un2ubl6u7zs.firebaseio-demo.com/');
And returns in my Chrome Console:
This is from the demo link, but I get exactly the same response in the console for any firebase DB I create. It's probably something REALLY simple, just trying to wrap my brain around Firebase, it's very different coming from a decade in the SQL world.
Thanks for pointers. :-)

You will only have access to Firebase, if you include the Firebase JavaScript client as a script:
<script src="https://cdn.firebase.com/js/client/2.4.0/firebase.js"></script>
This will make the Firebase object (and may others) available to your script.
I recommend that you start with this 5-minute interactive tutorial for Firebase. Adding the script tag is explain in step 1 there.
There was a similar question yesterday:
Uncaught ReferenceError: Firebase is not defined

This will not work with the new client.
see upgrade guide: https://firebase.google.com/support/guides/firebase-web

Related

Error while trying to create Firebase Firestore Database

I am new to Firebase. When I am creating a new Firestore database am getting this error
Enabling Cloud Firestore will prevent you from using Cloud Datastore with this project, notably from the associated App Engine app
All solutions I found online are completely targeting experts/individual who knows their way around Firebase and Google Cloud. To me, this error is a roadblock. I tried using my other Gmail accounts, creating new projects and the same error appears. even the cancel and close buttons seen are not working I have to refresh just to get back.
Kindly help or guide me what should I do.
Based on #JoshL.Minga and #RenaudTarnec comments, the issue was narrowed down to a specific browser. After switching to Safari it didn't reproduce.
This issue has been reported to Google support.
Aside from that, you may want to try creating a Frirestore DB using a brand new project. Make sure that your new project is created via the Firebase console and not in the GCP console.

How to trace exact issue from Firebase Crashlytics log in React Native App?

I have a React Native app with Firebase crashlytics integrated. I am forcefully crashing the app by calling function which does not exist. (this.test()).
I am getting logs in crashlytics, but looking at that logs I am not able to track the exact issue location.
Logs are quite generic and which is not helping me to pinpoint the issue.
Is there any way to get more info on that issue from logs? or anything I need to do so that I can get the issue location? if we are getting an issue in the inded.js file can we trace back the exact js file in app which is causing the issue.
Please help me with this information. Than you for helping.
Firebaser here - it sounds like you'd benefit from Crashlytics custom logging. This tool allows you to log any messages you want that get appended to the Crashlytics crash report that gets sent up to the console. I'm not sure how the React Native wrapper for Firebase Crashlytics works or if it allows you to do this, but according to the React Native Firebase reference doc you should be able to.
With this tool, you could call log in your code whenever you want to record information about the session, the user, or whatever's happening with code that you're executing in the background.

Topic Creating within Firebase Console

I was wondering how I can create a topic in the console of fire base. I see there is android code to do it from the application but that takes time to reflect on the console. I don't even know where to look if it was created. Also can this be done in Javascript compared to java?
Example code for JS would be nice if I cannot do it through the console.
Thanks,
You don't need to do anything in the console to create a topic. Just start using it by string name on both the server and client, and it will just work.

Dev environment for Google Cloud Functions

I followed the instructions and got the hello world route working online, but I cannot see how to get to a place where I can develop, i.e. to iterate locally. This is my code so far
exports.helloWorld = functions.onRequest((request, response) => {
response.send("Hello from Firebase!");
});
In particular I cannot access routes locally, and there is no reloading of code on save:
I tried firebase serve and then trying to reach localhost:5000/helloWorld but nothing happened at all.
firebase functions:shell led to an error being returned on the route:
"/helloWorld is not a recognized path."
I can see that from the firebase > I can run functions, but I'm trying to work with graphql so I wanted to use the graphiql web interface
And neither approach seemed to reload code when I changed things. ctrl+c, up-arrow, enter is currently my dev environment.
I'm surely missing stuff but https://firebase.google.com/docs/functions/local-emulator is difficult to follow. What am I missing?
If you've done everything correctly, firebase serve will give you the url of the HTTP function you're trying to emulate. It will contain the name of your project, the name of the Cloud region, and the name of the function. Something like this:
http://localhost:5000/YOUR-PROJECT/YOUR-REGION/helloWorld
If you don't see this URL in the output of firebase serve, then no functions are being emulated. Why that's happening is impossible to say with what you've provided here. Perhaps you're not modifying the correct index.js. Or you just forgot to save the file. Or perhaps you're running firebase serve from the wrong project location. In any event, if you're still having problems, you'll need to provide the exact steps you're taking from the moment of project creation that reproduces the problem.

Firebase Storage Trigger Not Working

I created a custom bucket which I use to serve content at a specific url. In Firebase I created a bucket called "images.mydomain.com" and I wanted to use this so my users can simply go to http://images.mydomain.com/imagename.jpg to access uploaded images.
I wanted to have a firebase trigger on my new bucket that does Google vision analysis on the image. Here is my function:
export const imageUploaded = functions.storage
.bucket('images.mydomain.com').object().onChange( event => {
//Cool stuff happens here
});
However, when I try to deploy the function I get this error in the console
⚠ functions[imageUploaded]: Deployment error.
Failed to configure trigger GCS Bucket: imagebucket
When I go to the function logs in Firebase I see the exact same error
Failed to configure trigger GCS Bucket: imagebucket
I also went to the Google Cloud Console to look at the functions to hopefully get some more insight on the issue. When I looked at the function, it had the correct bucket configured for the function but it had that exact same error without any explanation.
I have tried to create a new bucket using that but I get the exact same error. It seems that no matter what I do I keep getting the same error. I've tried adding permission and every It doesn't make any sense.
Does anyone know what this is about and/or how I can get this working? I had this working on the main bucket, but I really need this to work for my new bucket.
Thanks
A quick update:
I tried to deploy to my production environment (my app isn't in market yet so no one is actually using it) and it worked perfectly, the trouble is, I really need my development environment working which isn't right now.
To solve my issue I used this GitHub issue:
https://github.com/firebase/functions-samples/issues/66
Basically, there was no answer, I just had to shutdown my development project and start a new development project. Once I started a new project my functions deployed perfectly.

Resources