问题

在已有vue项目里使用prerender-spa-plugin插件时,遇到了build出来的页面是白屏或者出现{"statusCode":404,"error":"Not Found"}

解决

出现{"statusCode":404,"error":"Not Found"}的原因比较多,比如路由设置错误,配置文件有问题等等,这里需要仔细的去检查一下各个文件。

出现白屏我这里的原因如下图:

使用PrerenderSpaPlugin预渲染插件没有成功渲染

一个是index: path.resolve(__dirname, '../dist/myindex.html')要改成初始的index: path.resolve(__dirname, '../dist/index.html')

还有assetsPublicPath: '/jpress/templates/xiu/'要改成初始的assetsPublicPath: '/'

相关文章:

  • 2021-06-07
  • 2022-01-26
  • 2021-12-04
  • 2021-12-28
  • 2021-09-19
  • 2022-12-23
  • 2021-09-22
猜你喜欢
  • 2021-11-08
  • 2022-12-23
  • 2021-08-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案