Here is the code I currently have. I get this error in the console when the page opens:
Uncaught TypeError: The specifier “firebase/app” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.
I'm not sure why this is happening as I already installed firebase in the project with npm. Any help with configuring Firebase/Firestore for my npm project? If it helps, I am using Vercel to host the site. Thanks in advance!
// -------------------- Firebase --------------------
// Import
import { initializeApp } from "firebase/app";
import {
getFirestore,
collection,
addDoc,
query,
orderBy,
getDocs
} from "firebase/firestore";
// Config
const firebaseConfig = {
apiKey: "AIzaSyC5Z4qgNukP7bE4WcwDKZy4I2rfUu7JlyE",
authDomain: "my-website-f9ff7.firebaseapp.com",
projectId: "my-website-f9ff7",
storageBucket: "my-website-f9ff7.appspot.com",
messagingSenderId: "1048930604953",
appId: "1:1048930604953:web:4c0dc70917d6ce70f0e508"
};
// Initialize
const app = initializeApp(firebaseConfig);
const commentsDb = getFirestore();