firebase emulators:start the `__/firebase/init.js` points at the web and not local eumulators
See original GitHub issueI have my Firebase stuff setup locally and the emulators work fine (I can get into the UI and everything) but when I access my webapp locally at http://localhost:5000/ and look at the contents of init.js
all the variables point at the cloud datastore and stuff.
My unit tests will talk to the emulator by doing this:
var authenticatedApp = firebaseTesting.initializeTestApp({
databaseName: "blahblah-d46ae",
auth: { uid: "alice", email: "alice@example.com" }
})
beforeAll((done) => {
//initFirebase();
done()
})
afterAll((done) => {
//firebase.database().goOffline();
Promise.all(firebaseTesting.apps().map(app => {
app.delete()
})).finally(done)
})
How do I start the emulator so that init.js
will point to everything locally (functions, database, etc…)?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Run functions locally | Cloud Functions for Firebase - Google
The emulators:start command will start emulators for Cloud Functions, Cloud Firestore, Realtime Database, and Firebase Hosting based on the products you ...
Read more >Firestore/Firebase Emulator Not Running - Stack Overflow
Run firebase emulators:start . Check if displayed error request to install OpenJDK. If your functions interacts with Firebase APIs or Google ...
Read more >The Full Guide on how to use the Firebase Emulator for the Web
That's because the reads or writes to your local database don't count against your quota, ... firebase init emulators ... firebase emulators:start.
Read more >Local Testing With the Firebase Emulator Suite - Medium
json file. firebase init emulators. Choose functions, firestore, database to begin. We will go through the optional auth emulator, which has ...
Read more >How to configure Firebase emulators with Next.js?
The backend folder contains the functions, and it's where you initialize the Firebase project (i.e., run the firebase init com). The web folder ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@PaulRudin You can now opt-in to an emulated
init.js
by adding?useEmulator=true
flag, like so:For new projects initialized from the Firebase CLI, this flag will be automatically set for you in the generated
public/index.html
.This flag has no effect in production Firebase Hosting and it only configures enabled and running emulators. If you want the Auth Emulator, please run
firebase init emulators
first and check it from the list.This is still an issue, and now there’s an auth emulator, so presumably it should be possible to coax the emulator to do the right thing when running locally.