0

运行 razzle 的基本安装,我收到错误“Cannot GET /”,这就是我所做的:

https://github.com/jaredpalmer/razzle

npx create-razzle-app my-app cd my-app npm start

4

1 回答 1

1

对于绊倒这个的人:

在模板中需要更改 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';

来源: https ://github.com/jaredpalmer/razzle/issues/1022

于 2019-10-27T21:13:23.497 回答