node.js - 无法从 "firebase"解析 "src\containers\Login.js"

标签 node.js reactjs firebase react-native

当我运行 exp start 命令时出现此错误。我该如何解决这个错误?

这是我的 login.js 文件代码。 我是 React Native 的新手,使用 js 使用 expo 运行 native 应用程序,所以我陷入了困境。我不知道为什么它会给我这个错误以及如何处理它。

import React, { Component } from 'react';
import {
  Alert,
  StyleSheet,
  Text,
  View,
  TextInput,
  TouchableOpacity,
  Image,
  AsyncStorage,
  KeyboardAvoidingView,
  Dimensions,
  ActivityIndicator,
  NetInfo,
  BackHandler,
  DeviceEventEmitter
} from 'react-native';


import * as firebase from 'firebase';
import firebaseService from '../config/firebaseService';

import {Actions} from 'react-native-router-flux';
import Modal from "react-native-modal";

import { Dialog,ConfirmDialog } from 'react-native-simple-dialogs';

import Toast, {DURATION} from 'react-native-easy-toast';
import Expo from 'expo';

var height = Dimensions.get('window').height;
var width = Dimensions.get('window').width;

import styles from "../styles/loginStyle";
import {apiUrl,netErrorMsg,facebookId,androidGoogleClientId,iosGoogleClientId,firebaseConfig} from "../config/constant";


export default class Login extends Component<{}> {

    constructor(props) {
      super(props);
        this.state = {
          email:'',
          password:'',
          forgotEmail:'',
          versionName:'',
          loading:false,
          isModalVisible: false,
          netStatus:'none',
          dialogVisible:false,
          errorForgotEmail:""
        }

    }

最佳答案

看起来您正在尝试从某个文件中的 Login.js 导入 firebase。删除该导入并导入 firebase,因为您已将其导入到 Login.js 中。这将解决问题。

关于node.js - 无法从 "firebase"解析 "src\containers\Login.js",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54017755/

相关文章:

android - Firebase A/B 测试在推出领导者 100% 后仍在运行

node.js - 将meteor应用程序部署到heroku时,METEOR_SETTINGS is not valid json错误

javascript - Node.js 无需保存文件即可将 Mp3 流式传输到 http

reactjs - 如何在 React 和 Material UI 中访问更改组件内部项目的样式?

javascript - 如何在 map 期间将特定项目推送到新数组中?

firebase - 尝试部署Firebase函数部署错误: Failed to configure trigger

node.js - 在 Strongloop 中同时保存多个模型

node.js - NodeJs降级问题

javascript - 在javascript中异步函数之后运行函数

ios - Swift iOS 14 Firebase 警告——这个旧式函数定义之前没有原型(prototype)