每当我运行heroku local web
或推到Heroku时,都会出现以下错误。我已经尝试了几乎所有的堆栈答案,但到目前为止都没有帮助。该项目在npm启动时运行良好,并在本地运行良好。
这是我的index.js
import React from "react";
import ReactDOM from "react-dom";
import { createHashHistory } from "history";
import { Router, Route, Switch } from "react-router-dom";
import indexRoutes from "routes/index.jsx";
import "assets/scss/material-dashboard-pro-react.css?v=1.4.0";
const hist = createHashHistory();
ReactDOM.render(
<Router history={hist}>
<Switch>
{indexRoutes.map((prop, key) => {
return <Route path={prop.path} component={prop.component} key={key} />;
})}
</Switch>
</Router>,
document.getElementById("root")
);