记一个webpack [prerender-spa-plugin] Unable to prerender all routes! 问题

汪学真
2023-12-01

1.简介

使用prerender-spa-plugin做预渲染,但是每次都是跑了一会,然后报错

2.解决

找源码,node_modules/prerender-spa-plugin/es6/index.js,143行

    .catch(err => {
        const msg = '[prerender-spa-plugin] Unable to prerender all routes!'
        console.error(msg)
        compilation.errors.push(new Error(msg))
        done()
      })
  • 有err不打印,让人头疼

打印error

TimeoutError: Navigation Timeout exceeded: 30000ms exceeded
  • 有些js加载的慢了

 类似资料: