chrisvfritz / prerender-spa-plugin

Prerenders static HTML in a single-page application.
MIT License
7.31k stars 633 forks source link

[prerender-spa-plugin] Unable to prerender all routes! #469

Open Zzdl opened 2 years ago

Zzdl commented 2 years ago

image

my object have set 17 routers,when i npm run build, that will throw above error;but when i delete a router,it`s work,could you help me how to work for it?thanks very much!!!

jsbugwang commented 2 years ago

如果是 Webpack5

请使用 git@github.com:jsbugwang/prerender-spa-plugin.git 的 webpack5 分支。已提交 pull request 。详情请见 pr 470

如果不是 Webpack5

请自行增加调试代码,即可找到问题

--- a/es6/index.js
+++ b/es6/index.js
@@ -146,6 +146,8 @@ PrerenderSPAPlugin.prototype.apply = function (compiler) {
       })
       .catch(err => {
         PrerendererInstance.destroy()
+        // 增加这行调试代码
+        console.log(err)
         const msg = '[prerender-spa-plugin] Unable to prerender all routes!'
         console.error(msg)
         compilation.errors.push(new Error(msg))
Zzdl commented 2 years ago

如果是 Webpack5

请使用 git@github.com:jsbugwang/prerender-spa-plugin.git 的 webpack5 分支。已提交 pull request 。详情请见 pr 470

如果不是 Webpack5

请自行增加调试代码,即可找到问题

--- a/es6/index.js
+++ b/es6/index.js
@@ -146,6 +146,8 @@ PrerenderSPAPlugin.prototype.apply = function (compiler) {
       })
       .catch(err => {
         PrerendererInstance.destroy()
+        // 增加这行调试代码
+        console.log(err)
         const msg = '[prerender-spa-plugin] Unable to prerender all routes!'
         console.error(msg)
         compilation.errors.push(new Error(msg))

非常感谢,我试试~

zqcccc commented 2 years ago

https://webpack.js.org/blog/2020-10-10-webpack-5-release/#filesystems webpack 5 没有 mkdirp 方法了 There is not mkdirp method in webpack 5

Tofandel commented 2 years ago

Duplicate of https://github.com/chrisvfritz/prerender-spa-plugin/issues/414, not compatible with webpack 5