有没有办法确定为什么我的 React 应用程序显示空白页面,尽管我在 cpanel 上正确路由了它

Is there a way to determine why my react app is showing a blank page eventhough i routed it correctly on cpanel

这是我使用子目录进行路由的代码

class App extends Component {
render() {
return (
  <Router basename={"/build"}>
    <Provider {...stores}>
      <Switch>
        <Route path={`${process.env.PUBLIC_URL}/`} component={login} />
        <Route
          path={`${process.env.PUBLIC_URL}/Tardiness`}
          component={MainMenu}
        />
        <Route
          path={`${process.env.PUBLIC_URL}/Resources`}
          component={Dashboard}
        />
        <Route
          path={`${process.env.PUBLIC_URL}/company`}
          component={Company}
        />
        <Route
          path={`${process.env.PUBLIC_URL}/admin`}
          component={Admin}
        />
      </Switch>
    </Provider>
  </Router>
);



<IfModule mod_rewrite.c>

 RewriteEngine On
 RewriteBase /
 RewriteRule ^index\.html$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-l
 RewriteRule . /index.html [L]

</IfModule>

这是我的 htaccess 文件

我的主页将是网站。com/build

基本上我不知道去哪里寻找关于它因某种原因不显示的问题

我写这个作为答案,因为评论解决了这个问题。

路径需要相对于基础 URL。删除 ${process.env.PUBLIC_URL} 将使其按预期工作。