After transitioning my code from v8 to v9 with a modular approach, I encountered an error despite having the rollup package installed. Below is my JavaScript Code:
<script type="module">
// Necessary Firebase SDKs
// https://firebase.google.com/docs/web/setup#available-libraries
import firebase from 'firebase';
import { initializeApp } from "firebase/app"
import { getAuth, onAuthStateChanged } from "firebase/auth";
import { getDatabase } from "firebase/database"
// Firebase Configuration
const firebaseConfig = {
//app config
};
// Initialize Firebase
const firebaseApp = initializeApp(firebaseConfig);
const db = getDatabase(firebaseApp);
const auth = getAuth(firebaseApp);
</script>
The error message reads: Uncaught TypeError: Failed to resolve module specifier "firebase". Relative references must start with either "/", "./", or "../"
I have devoted significant time but haven't been able to pinpoint the issue.