prerender-spa-plugin icon indicating copy to clipboard operation
prerender-spa-plugin copied to clipboard

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

Open Zzdl opened this issue 3 years ago • 4 comments

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!!!

Zzdl avatar Sep 18 '21 08:09 Zzdl

如果是 Webpack5

请使用 [email protected]: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))

jsbugwang avatar Sep 28 '21 04:09 jsbugwang

如果是 Webpack5

请使用 [email protected]: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 avatar Oct 12 '21 06:10 Zzdl

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

zqcccc avatar Nov 03 '21 06:11 zqcccc

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

Tofandel avatar Apr 02 '22 21:04 Tofandel