运行Razzle的基本安装,我得到错误“ Cannot GET /”,这就是我所做的:
https://github.com/jaredpalmer/razzle
npx create-razzle-app my-app cd我的应用 npm start
答案 0 :(得分:0)
对于绊脚石的人们:
模板中的client.js需要更改
import BrowserRouter from 'react-router-dom/BrowserRouter';
到
import {BrowserRouter} from 'react-router-dom';
和在App.js中
import Route from 'react-router-dom/Route';
import Switch from 'react-router-dom/Switch';
到
import {Route,Switch} from 'react-router-dom';