React deep/nested 路由器在 firebase 上托管时无法正常工作

React deep/nested router not working when hosted on firebase

我已经检查了与我的这个问题相关的 Whosebug,但 none 解决了它。

我正在为我的 reactJS 应用程序使用嵌套路由,它在我的本地 webpack 服务器上运行良好,但在 firebase 托管上运行不正常。奇怪的是,它一直工作到 /admin/dashboard 路线,但任何进一步的路线都不起作用,即 /admin/list-bayaans/admin/listBayaans 它在浏览器中显示错误 [no matching route found]控制台。

Routes.js:

import React from 'react';
import {Route, IndexRoute, Link} from 'react-router';

import Layout from './components/layout';
import Homepage from './components/homepage';
import Bayaans from './components/bayaanspage';
import Readquran from './components/readquran';
import Duas from './components/duaspage';
import Events from './components/eventspage';
import Contactpage from './components/contact';

import AdminLayout from './components/admin/adminLayout';   // admin section (using same theme with little style variation)
import LoginPg from './components/admin/loginPage';
import Dashboard from './components/admin/dashboard';
import AdminBayaansPg from './components/admin/adminBayaansPage';
import AdminDuasPg from './components/admin/adminDuasPage';
import AdminEventsPg from './components/admin/adminEventsPage';

// we are defining 'home' route explicitly as an patch for now. So if user is on any innner page and he clicks the HOME menu then '/home' will render as '/' does not work and does nto return to the index page. Need to see it though.

export default (
            <div>
                 <Route path="/" component={Layout} >
                    <IndexRoute component={Homepage} />
                    <Route path="home" component={Homepage} />
                    <Route path="bayaans" component={Bayaans} />
                    <Route path="read-quran" component={Readquran} />
                    <Route path="duas" component={Duas} />
                    <Route path="events" component={Events} />
                    <Route path="contact" component={Contactpage} />
                 </Route>

                 <Route path="/admin" component={AdminLayout} >
                    <IndexRoute component={LoginPg} />
                    <Route path="dashboard" component={Dashboard} />
                    <Route path="list-bayaans" component={AdminBayaansPg} />
                    <Route path="list-duas" component={AdminDuasPg} />
                    <Route path="list-events" component={AdminEventsPg} />
                 </Route>
             </div>
);

问题:2 当我尝试通过使用 firebase deploy 命令更改路由在 firebase 上再次部署时,当我在浏览器中签入时,路由保持不变。 (是的,我正在重新捆绑我的代码,然后进行部署。此外,我只是在一条路线上进行了小的文本更改,只是为了调试,正如我在问题一开始提到的那样。即 /list-bayaans vs /listBayaans

注意:我也检查了这个link,但它不相关,并且已经有了这个link中提到的内容:

它正在运行。基本上 firebase 需要几分钟来加载新的部署更改(有时)。就我而言,大约需要 15 分钟。