My objective is to have the app running against the local emulator Firestore database and calling my cloud functions using the local emulator as well.
I followed along with the Firebase semi-live episode where he was using the emulators to test his cloud function locally (SQL-like joins in Cloud Firestore).
He added the following to his main js file:
if (window.location.hostname === ‘localhost’) {
firebase.firestore().settings({host: ‘localhost:8080’,ssl: false})
firebase.functions.useFunctionsEmulator(‘http://localhost:5001’)
}
I added the same to my boot/firebase.js file after firebase.initializeApp() and import firebase.firestore. I modified the firestore port to 8081 since my default for the Quasar dev server is also 8080.
In one terminal I run firebase emulators:start and in another run quasar dev.
On load the app tries to read a document from Firestore but I get a network error in the console. The function does get the document successfully if I comment out the above in my firebase.js boot file so I know it works.
Also, I have a cloud function that’s triggered when a new document is created in a collection. When I comment out the firebase.firestore.settings but leave firebase.functions.useFunctionsEmulator(‘http://localhost:5001’ I would expect that when I create a document on the google server it would trigger the function using the emulator. However it triggers the function on the firebase server as indicated in the logs and doesn’t trigger the function locally as nothing shows in the emulator log.
So I haven’t been able to test firestore or cloud functions locally with my Quasar project running in dev mode.
I found this posting on stackoverflow for pointing a Vue app to the emulators but I think it only applies if you're using the vue-cli.
https://stackoverflow.com/questions/60536897/how-to-tell-a-vue-app-to-use-firebase-emulator
Any help would be greatly appreciated.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/36a0eea8-70eb-4024-bf69-78bde3e694c2o%40googlegroups.com.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/2b3880ad-4d36-4a50-8ddb-266237900b3co%40googlegroups.com.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/08b898d7-82cd-4821-97e8-b472c1f421b1o%40googlegroups.com.