使用 Switch 和 react-router-dom 部署 Firebase 问题

Firebase Deploy problems using Switch and react-router-dom

我有一个应用程序,当我将此行添加到代码时无法部署到 Firebase:

 <Switch>
      <Route path='/:name' component={Business} />
 </Switch>

如果我在我的编辑器在线 Stackblitz 或本地主机上看到它,则数据呈现完美,但我无法部署正因为如此。

标准App代码如下:

import React from 'react';
import { Switch, Route } from 'react-router-dom';
import Business from './pages/business';

function App() {
  return (
    <Switch>
      <Route path='/:name' component={Business} />
    </Switch>
  );
}

export default App;

如果我将 Switch 和 Route 部分更改为例如,我可以部署:

   <div>  
      <h4>Hello World!</h4>
      <p>Start editing to see some magic happen :)</p>
   </div>

所以我认为一定是与 Firebase 不兼容。有什么想法吗?

Stackblitz 面板像附图一样卡住了。

[![在此处输入图片描述][2]][2]

求解!避免使用 Stackblitz 进行部署,