Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

234
Vistas
Snapshot is not defined

I am making clone of Linkedin and trying to use snapshot but it says error

import firebase from 'firebase';


const firebaseConfig = {
    apiKey: "mykey",
    authDomain: "domain",
    projectId: "linkedin-cl-37e0e",
    storageBucket: "somedata",
    messagingSenderId: "id",
    appId: "id",
    measurementId: "id"
  };




  const firebaseApp = firebase.initializeApp(firebaseConfig);
  const db = firebaseApp.firestore();
  const auth = firebase.auth();

  export{db, auth};
export default firebase;

but for some reason it is not working it says the following:

Module not found: Error: Package path . is not exported from package D:\linkedin\my-app\node_modules\firebase (see exports field in D:\linkedin\my-app\node_modules\firebase\package.json) Did you mean './firebase'? Requests that should resolve in the current directory need to start with './'. Requests that start with a name are treated as module requests and resolve within module directories (node_modules, D:\linkedin\my-app\node_modules). If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.

although i have done npm of firebase and tools as well. and for feed.js it says snapshot not defined

import React, { useState, useEffect } from 'react'
import './Feed.css'
import EditIcon from '@mui/icons-material/Edit';
import InputOption from './InputOption';
import ImageIcon from '@mui/icons-material/Image'
import SubscriptionsIcon from '@mui/icons-material/Subscriptions';
import EventNoteIcon from '@mui/icons-material/EventNote';
import CalendarViewDayIcon from '@mui/icons-material/CalendarViewDay';
import Post from './Post';
import { db } from './firebase';
import firebase from "./firebase";


function Feed() {

    const[input, setInput] = useState('');
    const[posts, setPosts] = useState([]);


    useEffect(() => {
        db.collection('posts').onSnapshot((onsnapshot) =>
            setPosts(
                onsnapshot.docs.map((doc) => ({
                id: doc.id,
                data: doc.data(),
            }))
        )
      );
  }, []);
      
    const sendPost = (e) => {
        e.preventDefault();

        db.collection('posts').add({
            name:'laeeq',
            description:'this is a test',
            message: input,
            photoUrl:'',
            timestamp: firebase.firestore.FieldValue.serverTimestamp(),
            
        });
    };

this is the issue please help its already been 12 hours plus

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda