groenroos


RangeError when generating individual pages from data

Operating system

macOS 14.2.1

Eleventy

2.0.1

Describe the bug

Creating individual pages from data using the pagination technique started suddenly returning a RangeError:

[11ty] Problem writing Eleventy templates: (more in DEBUG output)
[11ty] 1. Having trouble rendering njk template ./site/src/video/video.njk (via TemplateContentRenderError)
[11ty] 2. Having trouble compiling template ./site/src/video/video.njk (via TemplateContentCompileError)
[11ty] 3. (./site/src/video/video.njk)
[11ty]   RangeError: Maximum call stack size exceeded (via Template render error)
[11ty]
[11ty] Original error stack trace: Template render error: (./site/src/video/video.njk)
[11ty]   RangeError: Maximum call stack size exceeded
[11ty]     at Object._prettifyError (/node_modules/nunjucks/src/lib.js:32:11)
[11ty]     at Template.init (/node_modules/nunjucks/src/environment.js:416:19)
[11ty]     at Template.Obj (/node_modules/nunjucks/src/object.js:51:15)
[11ty]     at new Template (/node_modules/nunjucks/src/environment.js:390:18)
[11ty]     at Nunjucks.compile (/node_modules/@11ty/eleventy/src/Engines/Nunjucks.js:406:14)
[11ty]     at TemplateRender.getCompiledTemplate (/node_modules/@11ty/eleventy/src/TemplateRender.js:278:26)
[11ty]     at Template.compile (/node_modules/@11ty/eleventy/src/TemplateContent.js:362:42)
[11ty]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[11ty]     at async Template._render (/node_modules/@11ty/eleventy/src/TemplateContent.js:486:16)

This is similar to #498, but in my case, I'm not using macros or nested loops (or indeed any loops at all) in the template the error is complaining about - the same error happens even if the markup of the paginated template is empty.

Mitigation attempts

Reproduction steps

Template I'm using for generating pages using pagination:

---json
{
	"pagination": {
		"data": "videos",
		"size": 1,
		"alias": "video",
		"addAllPagesToCollections": true
	},
	"tags": "video",
	"eleventyComputed": {
		"title": "{{ video.title }}",
		"permalink": "video/{{ video.slug }}/"
	}
}
---

The videos data is an array of objects like so;

[
  {
    title: "Foo",
    slug: "foo"
  },
  ..
]

In my case, once the array started to contain 191 items, the error started to appear. The objects in my array contain additional metadata keys irrelevant to a minimal reproduction.

Expected behavior

The build should finish without errors and generate all the pages, regardless of the length of the data array

Reproduction URL

No response

Screenshots

No response