Click here to Skip to main content
15,174,232 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to implement firebase in the next.js file
but i keep getting the error module not found
(i already use yarn add firebase)

What I have tried:

file where i want to implement firebase

import { useSession } from 'next-auth/client';
import { EmojiHappyIcon } from "@heroicons/react/outline";
import { CameraIcon,VideoCameraIcon } from "@heroicons/react/solid";
import{  useRef } from "react";
import { db } from "../../firebase";
import firebase from "../../firebase";
function InputBox() {
    const [session]=useSession();
    const inputRef=useRef(null);

    const sendPost = (e) => {

    if(!inputRef.current.value) return;

        message: inputRef.current.value,
        image: session.user.image,
        timestamp: firebase.firestore.FieldValue.serverTimestamp()


firebase file
import firebase from "./firebase";
import "firebase/storage";
const app = !firebase.apps.length ? firebase.initializeApp(firebaseConfig) : ;
const db = app.firestore();
const storage=;

export { db, storage }; 
Updated 4-Nov-21 23:47pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900