Unable to prerender all routes! 100 routes
Author: carljustineoyalesCreated Mar 9, 2021Updated Apr 2, 2022
i have a vue project the gets blogpost from a headless cms. the problem there is over 100+ blogpost on that cms. prerendering it gave me this error
[prerender-spa-plugin] Unable to prerender all routes!module.exports = (api, options) => {
api.registerCommand("build:prerender", async (args) => {
const { data } = await axios({
method: "get",
url: "https://projectname.microcms.io/api/v1/portfolio?limit=999",
headers: {
"X-API-KEY": "X-API-KEY",
},
});
api.chainWebpack((config) => {
config.plugin("prerender").use(PrerenderSPAPlugin, [
{
// Required - The path to the webpack-outputted app to prerender.
staticDir: path.join(__dirname, "dist"),
// Required - Routes to render.
routes: ["/"].concat(
data.contents.map((post) => {
return `/post/${post.id}`;
})
),
renderer: new Renderer({
injectProperty: "__PRERENDER_INJECTED",
inject: {
prerendered: true,
},
renderAfterElementExists: "[ready]",
headless: true,
ignoreHTTPSErrors: true,
maxConcurrentRoutes: 4,
}),
},
]);
});
await api.service.run("build", args);
});
};can anyone help me? i tried changing the maxConcurrentRoutes and still gives me that error
Source: chrisvfritz/prerender-spa-plugin