Suman Shaw
Suman Shaw

Reputation: 143

Can't resolve path of imported file in React Native

I'm new to React Native. I get import errors like this when I try to import a class from another file in React Native. How can I resolve this ? (I'm using react-navigation 2.18.3)

C:/Users/Suman Shaw/Login/components/Login.js
Module not found: Can't resolve '../config/firebaseSDK' in 'C:\Users\Suman Shaw\Login\components'
[![my folder hierarchy][1]][1]

package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "expo": "~36.0.0",
    "firebase": "^7.9.3",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
    "react-native-gifted-chat": "^0.13.0",
    "react-native-web": "~0.11.7",
    "react-navigation": "^2.18.3",
    "uuid": "^7.0.1"
  },
  "devDependencies": {
    "babel-preset-expo": "~8.0.0",
    "@babel/core": "^7.0.0"
  },
  "private": true
}

Upvotes: 1

Views: 661

Answers (1)

Prakash Reddy Potlapadu
Prakash Reddy Potlapadu

Reputation: 1001

Can't resolve '../config/firebaseSDK' means you are giving wrong path

import as '../../'till you find config

you can refer this https://www.youtube.com/watch?v=ephId3mYu9o

Upvotes: 1

Related Questions