<script type="module">
import { initializeApp } from 'firebase/app';
import { getDatabase } from 'firebase/database';
// TODO: Replace the following with your app's Firebase project configuration
const firebaseConfig = {
config
};
const app = initializeApp(firebaseConfig);
const database = getDatabase(app)
</script>
The Uncaught TypeError occurs in line 2. What is the problem?
Usually, this happens because firebase's newest version tools for developers for tools like database, auth , etc, are buggy. Install an older version of firebase. That will surely do the trick.
(I am guessing you are using NPM or Yarn to install them, so do something like npm i firebase@5.10.0)