首页 > 解决方案 > Unable to resolve module `./index.android` from The module `./index.android` could not be found from Indeed, 这些文件都不存在:

问题描述

当我使用firebase将facebook auth与react-native连接时产生错误

fbAuth() {
LoginManager.logInWithReadPermissions([
  "public_profile",
  "user_friends",
  "email"
]).then(
  result => {
    if (result.isCancelled) {
      Alert.alert("Whoops!", "You cancelled the sign in.");
    } else {
      AccessToken.getCurrentAccessToken().then(data => {
        const credential = firebase.auth.FacebookAuthProvider.credential(
          data.accessToken
        );
        firebase
          .auth()
          .signInWithCredential(credential)
          .then(loginUserSuccess(dispatch))
          .catch(error => {
            loginSingUpFail(dispatch, error.message);
          });
      });
    }
  },
  error => {
    Alert.alert("Sign in error", error);
  }
);}

没有发现任何模块的问题这是我的代码,我在其中集成了 fb auth 代码

标签: javascriptandroidreact-native

解决方案


您导入文件的方式是错误的。检查您正在导入的路径并更正它。它会工作


推荐阅读