firebase.auth () зависает, когда отладка chrome включена

#firebase #react-native #react-redux

#firebase #react-native #react-redux

Вопрос:

При использовании тех же учетных данных действие входа в систему зависает в firebase.auth() при включенной отладке chrome. Он зависает, пока я не нажму на экран. Только после этого происходит вход в систему.

Как только я выключу chrome debug, действие входа в систему, включая. firebase.auth () выполняется так быстро, как ожидалось.

вот мой package.json, на который повлияло действие:

Экшен:

 export const loginUser = ({ email, password }) => (dispatch) => {
  dispatch({ type: LOGIN_USER });
  return firebase
    .auth()
    .signInWithEmailAndPassword(email, password)
    .then((user) => {
      setTimeout(() => null, 0);
      dispatch(() => saveCredentials(email, password))
        .then(dispatch(loginUserSuccess(user)))
        .then(dispatch(weekplanFetch()))
        .then(dispatch(recipeLibraryFetch()))
        .then(() => {
          NavigationService.navigate('Home');
        });
    })
    .catch((error) => {
      console.log(`sign in fail ${error}`);
      return firebase
        .auth()
        .createUserWithEmailAndPassword(email, password)
        .then((user) => {
          dispatch(() => saveCredentials(email, password))
            .then(dispatch(loginUserSuccess(user)))
            .then(dispatch(initWeekplan()))
            .then(dispatch(initRecipeLibrary()))
            .then(() => {
              NavigationService.navigate('Home');
            });
        })
        .catch((userCreateFail) => {
          // console.log(`user create fail ${userCreateFail}`);
          dispatch(loginUserFail(userCreateFail.message));
        });
    });
};
  

package.json

 {
  "name": "WhatsForDinner",
  "version": "1.0.5",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "ios:beta": "(cd ios/ amp;amp; bundle exec fastlane beta)",
    "ios:commit": "cd ios/ amp;amp; bundle exec fastlane commit",
    "lint": "eslint .",
    "lint:fix": "eslint . --fix",
    "prettier": "prettier --write '*.js'",
    "format-code": "yarn run prettier amp;amp; yarn run lint:fix",
    "precommit": "lint-staged",
    "test:coverage": "jest --coverage amp;amp; open coverage/lcov-report/index.html"
  },
  "lint-staged": {
    "*.js": [
      "yarn run format-code",
      "git add",
      "jest --bail --findRelatedTests --coverage"
    ]
  },
  "dependencies": {
    "firebase": "^5.8.6",
    "prop-types": "^15.6.0",
    "react": "16.6.3",
    "react-native": "0.57.8",
    "react-native-code-push": "^5.5.2",
    "react-native-image-picker": "^0.28.0",
    "react-native-keychain": "^3.0.0",
    "react-native-paper": "^1.12.0",
    "react-native-vector-icons": "^6.4.1",
    "react-navigation": "^1.6.1",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "yarn": "^1.9.4"
  },
  "devDependencies": {
    "babel-eslint": "^8.2.2",
    "babel-jest": "^23.4.2",
    "babel-preset-react-native": "^5",
    "enzyme": "^3.7.0",
    "enzyme-adapter-react-16": "^1.6.0",
    "eslint": "^4.18.1",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.12.3",
    "husky": "^0.14.3",
    "jest": "22.4.2",
    "jest-fetch-mock": "^2.1.0",
    "lint-staged": "^7.2.2",
    "prettier": "1.10.2",
    "react-dom": "^16.7.0",
    "react-test-renderer": "16.4.1",
    "redux-mock-store": "^1.5.3"
  },
  "jest": {
    "preset": "react-native",
    "setupFiles": [
      "<rootDir>/tests/setup.js"
    ],
    "transform": {
      "^. \.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
    },
    "collectCoverageFrom": [
      "app/**/*.js",
      "!app/components/index.js"
    ],
    "transformIgnorePatterns": [
      "node_modules/(?!(jest-)?react-native|react-navigation)"
    ]
  }
}
  

Комментарии:

1. у меня возникла эта проблема. я следую

2. Отладчик RN печально известен проблемами такого рода

3. что я пробовал до сих пор: — закрыть упаковщик, симулятор, chrome — выполнить watchman watch-del-all amp;amp; rm -rf $TMPDIR/react-* amp;amp; rm -rf node_modules/ amp;amp; npm cache verify amp;amp; npm install amp;amp; npm start -- --reset-cache — run react-native run-ios но все та же проблема, прежде чем появилась эта проблема, я обновил свою версию react native с помощью react-native-git-upgrade с 0.56.0 до 0.57.0, а затем с небольшими шагами до версии 0.57.8

4. Есть ли какая-либо другая информация, которой я должен поделиться, которая могла бы помочь найти причину?