react 打包后动态路由加载的组件渲染不出来

#1

百度查看了很多相关资料:
1、npm run build
2、修改nginx里面的conf

server {
        listen       8800;
        server_name  localhost;
        root   /Users/ilovegym/cloudcatelog/build;
        index  index.html index.htm;  	
        charset utf-8;
        location / {
              #try_files $uri $uri/ /index.html;
              try_files $uri /index.html;
        }
}

但启动nginx看到的还是空白页面,只显示网页的标题和标题栏的ICON。
请教各位大神!

#2

路由改成HashRouter也不行

#3

Console 里应该还有报错吧

#4

没有任何报错信息

#5

发现是react-router没有正常工作,但不知道需要怎么设置?

#6

发现是动态路由的问题

#7

下面这个动态路由有问题

{
                      routes.map((value, key) => {
                          return (
                              // 路由器的父子路由传值
                              <Route key={key} exact={value.exact} path={value.path}
                                     render={props => (
                                         <value.component{...props} routes={value.routes}/>
                                     )}
                              />
                          )
                      })
                  }
#9

大神帮忙看看哪有问题呀
x

#10

不用动态路由就可以运行,求解!!!!!?

a

#11

问题解决了,问题来得有些荒唐,把动态路由上的注释行删掉就可以了。可能是打包后//会有问题