React router:在动态路由刷新错误中嵌套静态路由

raz*_*ngo 1 reactjs react-router

我在react-router 2.0.0-rc中遇到了browserHistory的问题.我试图通过使用用户名的react-router参数来获得一个编辑页面,然后是一个名为"edit"的嵌套静态路由.当我使用react-router链接时,页面按预期加载,但在手动输入URL或刷新后,页面显示为空白且包含错误Uncaught SyntaxError: Unexpected token <.

我所有的其他路线都很好.不幸的是,所有的文档似乎都使用静态,然后是动态路由参数,而不是相反.

这是我的路线:

<Route path="/" component={App} onEnter={currentUserCheck}>
    <IndexRoute component={HomePage} />
    <Route path="/signup" component={SignupForm} />
    <Route path="/login" component={LoginForm} />
    <Route path="/chart" component={PollResult} />
    <Route path="/:username/edit" component={EditProfile}/>
    <Route path="/:username" component={ProfilePage}/>
    <Route path="*" component={NoMatch}/>
</Route>
Run Code Online (Sandbox Code Playgroud)

raz*_*ngo 5

我想到了.我需要/在我的index.html中放一个我的bundle和css文件.我的其他路线很好,因为它们是顶级路线,但一旦我向下移动到嵌套路线,我就失去了对静态资产的引用.