You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<html><head><metacharset="utf-8"><title>DB Instance Name Bug</title><scriptdefersrc="/__/firebase/8.2.1/firebase-app.js"></script><scriptdefersrc="/__/firebase/8.2.1/firebase-database.js"></script><scriptdefersrc="/__/firebase/init.js?useEmulator=true"></script></head><body><script>document.addEventListener('DOMContentLoaded',function(){firebase.database().ref('/messages').once('value').then((snapshot)=>console.log(snapshot.val()),(error)=>console.log(error));});</script></body></html>
[REQUIRED] Steps to reproduce
Create a new project in the Firebase console.
Make a new local directory for the project with firebase init.
A. Select the project from (1).
B. Select database, hosting, emulators.
C. Accept all defaults.
Create public/index.html and functions/index.js as above
All three emulators, Functions, Database, and Hosting should all refer to the same instance.
When the page is loaded in (6), an object with the message from (5) should be logged to the console.
I have verified that this project works as intended when deployed to production.
[REQUIRED] Actual behavior
The Functions emulator and the Database emulator both use http://localhost:9000?ns=*project-id*, but the Hosting emulator connects to ws://localhost:9000/.ws?v=5&ns=project-id-default-rtdb
The Hosting emulator uses a database with the "-default-rtdb" suffix, while the other two emulators do not use that suffix.
When the page is loaded in (6), a "null" is logged to the console.
After loading the page, the database emulator shows two databases, one with and one without the "-default-rtdb" suffix.
The text was updated successfully, but these errors were encountered:
@bkeil thank you for reporting this and for the excellent reproduction steps. I can confirm this issue and it's actually a problem in the Functions emulator, where we are making the assumption that your Database URL is https://<PROJECT-ID>.firebaseio.com which is no longer a safe assumption now that we no longer create a default namespace on project creation!
[REQUIRED] Environment info
firebase-tools:
9.1.0
Platform: Raspbian
Linux raspberrypi 5.4.79-v7l+
[REQUIRED] Test case
functions/index.js
public/index.html
database-debug.log
firebase-debug.log
pubsub-debug.log
ui-debug.log
[REQUIRED] Steps to reproduce
firebase init
.A. Select the project from (1).
B. Select database, hosting, emulators.
C. Accept all defaults.
firebase emulators:start
http://localhost:5000/
[REQUIRED] Expected behavior
All three emulators, Functions, Database, and Hosting should all refer to the same instance.
When the page is loaded in (6), an object with the message from (5) should be logged to the console.
I have verified that this project works as intended when deployed to production.
[REQUIRED] Actual behavior
The Functions emulator and the Database emulator both use http://localhost:9000?ns=*project-id*, but the Hosting emulator connects to ws://localhost:9000/.ws?v=5&ns=project-id-default-rtdb
The Hosting emulator uses a database with the "-default-rtdb" suffix, while the other two emulators do not use that suffix.
When the page is loaded in (6), a "null" is logged to the console.
After loading the page, the database emulator shows two databases, one with and one without the "-default-rtdb" suffix.
The text was updated successfully, but these errors were encountered: