mnfst-render 0.5.18 → 0.5.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3093,7 +3093,20 @@ async function runPrerender(config) {
3093
3093
  pagesSinceRecycle++;
3094
3094
  break; // success
3095
3095
  }
3096
- if (attempt >= maxRetries) { pagesSinceRecycle++; break; }
3096
+ if (attempt >= maxRetries) {
3097
+ // Exhausted retries — likely an unstable browser (e.g. cascading
3098
+ // "detached Frame" errors). Force a recycle counter past the
3099
+ // threshold so the next path triggers a fresh browser.
3100
+ pagesSinceRecycle = Math.max(pagesSinceRecycle + 1, browserRecycleEvery);
3101
+ break;
3102
+ }
3103
+ // Halfway through retries with no success → preemptively recycle the
3104
+ // browser before the next attempt. This unblocks cascading frame
3105
+ // failures where the browser process needs a fresh start.
3106
+ if (attempt + 1 >= Math.ceil(maxRetries / 2) && pagesSinceRecycle > 0) {
3107
+ pagesSinceRecycle = Math.max(pagesSinceRecycle, browserRecycleEvery);
3108
+ await maybeRecycleBrowser();
3109
+ }
3097
3110
  failedPaths.pop();
3098
3111
  attempt++;
3099
3112
  const displayPath = pathSeg === '' ? '/' : (pathSeg === NOT_FOUND_PATH ? '/__prerender_404__' : '/' + pathSeg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst-render",
3
- "version": "0.5.18",
3
+ "version": "0.5.19",
4
4
  "description": "Render Manifest sites to static HTML for SEO",
5
5
  "type": "module",
6
6
  "bin": {