小编Jos*_*osh的帖子

在 React-Boilerplate 中使用 Firebase 身份验证时,Service Worker 会捕获对 Google 的 __/auth 请求

当使用firebase.auth().signInWithPopup(firebase.auth.GoogleAuthProvider())弹出窗口打开但不重定向到accounts.google 登录页面时,它会转到我的应用程序的页面未找到路由。我相信这与通过offline-plugin制作的服务工作者有关。这是内置在React-boilerplate 中的,该项目使用的是 v3。我也在使用react-redux-firebase,它总体上运行良好,所以我不认为这是设置的问题。

Webpack 产品文件

// Important modules this config uses
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const WebpackPwaManifest = require('webpack-pwa-manifest');
const OfflinePlugin = require('offline-plugin');
const { HashedModuleIdsPlugin } = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const CompressionPlugin = require('compression-webpack-plugin');

module.exports = require('./webpack.base.babel')({
  mode: 'production',

  // In production, we skip all hot-reloading stuff
  entry: [
    require.resolve('react-app-polyfill/ie11'),
    path.join(process.cwd(), 'app/app.js'),
  ],

  // Utilize long-term caching by adding content hashes (not compilation hashes) …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs webpack service-worker firebase-authentication

7
推荐指数
1
解决办法
594
查看次数