angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

How to use European databaseURL in version 5.0.0-rc.10

Open EmanueleGuidotti opened this issue 3 years ago • 3 comments

Hello there and thanks for your support. I'd like to know if I can use the Europen databaseURL inside the firebase credentials. At the moment it causes an error with version 5.0.0-rc.10. I've two different projects in firebase console: one located in America and one in Europe, I'm tying to migrate the app with the database located in Europe and it seems the plugin doesn't like the string with suffix firebasedatabase.app but likes the string with the suffix firebaseio.com as you can see in the error image.

Version info

Angular: 6.1.10

Firebase: 5.5.7

AngularFire: 5.0.0-rc.10

Other (e.g. Ionic/Cordova, Node, browser, operating system): ionic-angular 3.9.9

How to reproduce these conditions

https://stackblitz.com/edit/angular-fire-start-jvw9gl?file=app%2Fapp.module.ts

Steps to set up and reproduce

  • Create an ionic project
  • Install angularfire2 version 5.0.0-rc.10
  • Install firebase 5.5.7
  • Run ionic serve

Debug output

Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com 
    at fatal (http://localhost:8100/build/vendor.js:108722:11)
    at parseRepoInfo (http://localhost:8100/build/vendor.js:109644:9)
    at RepoManager.databaseFromApp (http://localhost:8100/build/vendor.js:123375:25)
    at Object.instance.INTERNAL.registerService.Reference [as database] (http://localhost:8100/build/vendor.js:123716:130)
    at FirebaseAppImpl._getService (http://localhost:8100/build/vendor.js:40892:66)
    at FirebaseAppImpl.<computed> [as database] (http://localhost:8100/build/vendor.js:41081:31)
    at http://localhost:8100/build/vendor.js:106603:24
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14976)
    at r.run (http://localhost:8100/build/polyfills.js:3:10143)
    at NgZone.runOutsideAngular (http://localhost:8100/build/vendor.js:4230:28)

Expected behavior

Use the European firebase database URL inside the config

Actual behavior

A firebase fatal error, which says: Cannot parse Firebase URL

EmanueleGuidotti avatar Feb 10 '22 09:02 EmanueleGuidotti

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Feb 10 '22 09:02 google-oss-bot

To use European DB you need to set up one first. If you look into config you will see the database URL that shows your server location normally it is us-central1.

If you have initialized the firestore or real-time database with Europe central server then it should work just fine.

But if you have already initialized the database then you need to create another project and set new servers in it.

Sapython avatar Mar 09 '22 15:03 Sapython

I have a European database already created but when I try to insert the config string it causes an error as I wrote in my issue. The error said Please use https://<YOUR FIREBASE>.firebaseio.com so it seems it doesn't like the European URL which ends with firebasedatabase.app. Actually, I'm using the version 5.0.0-rc.10. Any help?

EmanueleGuidotti avatar Mar 16 '22 07:03 EmanueleGuidotti