I'm following the "Build a mobile app" section of the Learn JavaScript course (a part of the full-stack specialisation) on the Coursera platform, and I'm having an issue setting up the database environment variable.
I've created a new Firebase project and created a new Firebase Realtime Database. So far, my code looks like this: (see attached screenshot).
I've used the URL that Firebase created for "import { initializeApp }" and for "import { getDatabase }" (lines 1 & 2).
For the Scrim environment, I've used DATABASE_URL as the name, and I've used the database URL that Firebase generated as the value.
When I use "console.log(firebaseConfig.databaseURL)" to log it out, the error message I receive is as follows:
! [2026-01-26T09:03:32.209Z] @firebase/database:
,"FIREBASE FATAL ERROR: Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp(). "
- (also see the second screenshot)
To the best of my knowledge, I've followed along exactly as instructed. When using console.log in all the previous steps to check that it was working, it was working fine, and the console returned the expected result. So, the only thing I could think of that it might be, if I'm at fault, is the environment name and/or value that is tripping me up. The instructions on exactly what the environment name and value should be were not very explicit.
Perhaps there's something else I'm missing here? Or maybe it's to do with the fact that I'm doing the coursework on a platform outside of Scrimba? I went to Scrimba.com to see if doing the coursework on the actual website would make a difference, but I couldn't find the "Build a mobile App" module in the Fullstack Developer Path.
In any case, I've received the certificate of completion for the Learn JavaScript course already, so I suppose this is like "extra content", but I would like to be able to give this a crack if it's possible.
Any help or suggestions would be much appreciated.
Thanks, all!