语法错误:意外的标识符,每当我运行Heroku本地网站时

时间:2018-11-27 07:05:25

标签: reactjs heroku webpack

A screenshot of Heroku local web.

每当我运行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")
);

0 个答案:

没有答案