When creating a new web app within firebase the database URL is missing

Viewed 542

When I setup a new web app in firebase I noticed that the databaseURL is missing in the config.

apiKey: "",
authDomain: "",
projectId: "",
storageBucket: "",
messagingSenderId: "",
appId: "",
measurementId: ""

Those are the only values I can get. I haven't created a realtime database. But I have no need to.

I am working with the firebase plugin

"firebase": "^8.2.7"

in Nuxt but it is complaining that the databaseURL is missing. I throws the following error

Missing or incomplete config for current environment 'development': key 'databaseURL' is required!

So should I either get a databaseURL from firebase or is it a problem on the nuxt side?

1 Answers

When you create a new project in Firebase, it no longer immediately creates a Realtime Database for that project. For that reason, the databaseURL key is no longer included in the config, unless you've created a Realtime Database instance in the Firebase console.

Most Firebase SDK have been updated to deal with the fact that this databaseURL key is now optional, but it looks like you're on an environment where it is still required.

The two simplest solutions I can think of are:

  1. Manually add a databaseURL key to the config. Most likely you can leave the value as an empty string.
  2. Go to the database panel in the Firebase console to create a Realtime Database, and download the updated config.

Of course, if you actually use the Realtime Database in your code, the second option is the only one that will work.

Related