组件加载我现在面临一个奇怪的错误为低于路由器规范阵营,路由器不会直接刷新
<Provider store={store}>
<Router history={history}>
<Route path="/" component={AppContainer}>
<IndexRoute component={Home}/>
<Route path="projects" component={ProjectContainer} />
<Route path="projects/new" component={newProject} />
</Route>
</Router>
</Provider>,document.getElementById('app')
我能够浏览到/
和/projects
通过在浏览器中直接输入网址。但它不适用于/projects/new
。该网页是空白的(甚至没有标准cannot GET /projects/new
,我只能从/projects
或/
页面导航导航到URL。
我在的WebPack historyApifallback设置为true。我要去哪里错了?
编辑:这是在加载/项目下面的console.log /新
new:8 GET http://localhost:8080/projects/styles.css
new:18 GET http://localhost:8080/projects/bundle.js
我的index.html似乎在寻找/父母的JS和CSS文件,同时它应位于根
<link rel="stylesheet" href="styles.css">
<script src="bundle.js" charset="utf-8"></script>
在导航到“/ projects/new”时,您是否在控制台中获得任何输出?如果是这样,请编辑您的问题并添加错误/警告。 – Chris
包含console.log ...它看起来像webpack的一些错误..生病看看这个 – Kannaj