Archana
Archana

Reputation: 1

Module not found.Can't resolve '../firebase/config'

Project Directory image

I am trying to import firebase in my react app, using the following syntax:

import {auth} from '../firebase/config

But I am facing following issue:

./src/Pages/Login/Login.js Module not found: Can't resolve '../firebase/config'

this is my config file

import * as firebase from '/firebase/app' import 'firebase/auth'; import 'firebase/firestore'

// Firebase configuration const firebaseConfig = { apiKey: "", authDomain: "", projectId: "", storageBucket: "", messagingSenderId: "*****", appId: "******" };

// Initialize Firebase firebase.initializeApp(firebaseConfig);

const firestore =firestore.firestore(); const auth = firebase.auth();

export { auth, firestore };

thanks for your help in advance

Upvotes: 0

Views: 718

Answers (1)

Dharmaraj
Dharmaraj

Reputation: 50840

Your path is incorrect. '../firebase/config' will look for the config file in src/Pages/firebase but the config is present in src/firebase. Try this path instead:

import {auth} from '../../firebase/config'
//                  ^^

Upvotes: 0

Related Questions