Why does prerender-spa-plugin package report to Unable to prerender all routes??

after prerender-spa-plugin@3.2.1 is installed and configured, build, will appear when there are more than 12 routes to be rendered. Unable to prerender all routes, will always be in building for production.. It doesn"t stop. After studying for a long time, I can"t find a way. Now I can only pack the route in two batches. It doesn"t feel good.

webpack.prod.conf.js

    const PrerenderSPAPlugin = require("prerender-spa-plugin")
    const Renderer = PrerenderSPAPlugin.PuppeteerRenderer
    new PrerenderSPAPlugin({
      // webpakc
      // 
      staticDir: path.join(__dirname, "../dist"),

      // index /index/param1
      //
      //
      routes: ["/", "/activity", "/seven-star", "/order", "/special", "/admission", "/information", "/red-lines", "/wechat", "/share", "/resources", "/express", "/introduce", "/join-in", "/contact"],

      // 
      renderer: new Renderer({
        ignoreJSErrors: true,
        inject: {
          foo: "bar"
        },
        headless: false,
        //  main.js  document.dispatchEvent(new Event("render-event"))
        renderAfterDocumentEvent: "render-event",
        renderAfterTime: 5000
      })
    })

error message:

ask for the help of all the great gods

Aug.20,2021

clipboard.png
main.js switch mode


which one is removed, and both are removed at the same time?
routes: ['/','/ explore','/ exploreDesc','/ exploreList','/ product','/ productDetial','/aboutus','/contactUs','/joinUs','/information','/stores','/appdown','/develop','/devDetial','/law','/faq','/map','/housekeeper','/life','/proList', '/ job'],
should all routes configured in route.js be written here?


headless: true
It helps me!
Reference:
https://juejin.cn/post/684490.
" sets headless: false under mac to prompt Unable to prerender all routes! Google told me that I could not use routing lazy loading. In fact, there are many reasons for this error. I wish I had set up headless: true! "

Menu