FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
See original GitHub issueHi,
I try to prerender a relative big amount of page in webpack, ~800 pages. Webpack never end and throw me next error: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
As recomend, I use @prerenderer/renderer-jsdom
Here my plugin config, I don’t understand why it take so many memory In my test I limit the 800 pages to first 200 and 1494Mb seem not be enough
const PrerenderSpaPlugin = require('prerender-spa-plugin')
const JSDOMRenderer = require('@prerenderer/renderer-jsdom')
new PrerenderSpaPlugin({
renderer: new JSDOMRenderer({
maxConcurrentRoutes: 50,
renderAfterDocumentEvent: 'app-rendered',
renderAfterTime: 4000
}),
staticDir: path.join(__dirname, '../build'),
outputDir: path.join(__dirname, '../build'),
routes: urlsToPrerender,
// renderAfterDocumentEvent: 'app-rendered',
postProcess (renderedRoute) {
const $ = cheerio.load(renderedRoute.html)
$('head').children().each(function() {
var Src = this.attribs.src
if(Src !== undefined) {
if(Src.indexOf('maps.googleapis.com') !== -1) {
$(this).remove();
}
}
});
renderedRoute.html = $.html()
return renderedRoute
},
})
Thanks for your help
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed ...
Your code works fine for me with Node.js 0.10.28. It took 1200 MB of virtual memory and printed an unbelievable amount of junk...
Read more >JavaScript heap out of memory - Snyk Support
FATAL ERROR : CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of ... You can increase the amount of memory allocated to the command...
Read more >How to resolve - FATAL ERROR: CALL_AND_RETRY_LAST ...
FATAL ERROR : CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory How to get rid of this issue?Is it related to physical ......
Read more >FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed
I'm trying to deploy my app but I'm getting this error: 7:13:48 PM: Creating an ... Allocation failed - JavaScript heap out of...
Read more >How to Fix JavaScript Heap Out of Memory Error - MakeUseOf
This error usually occurs when the default memory allocated by your system to Node. js is not enough to run a large project....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wow. Have you tried using
PuppeteerRenderer
and something likemaxConcurrentRoutes: 10
?@Kleinast Interesting. Good luck!