You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I ran into a loop during build because I was carelessly using search & replace in my code. 馃槈
To Reproduce
Create a layout page.njk with the frontend matter
---
layout: page.njk
---
Create a page using this layout
Run npx eleventy
Eleventy seemed to be happy to oblige and I just noticed my mistake because the build seemed to run forever. (I didn't wait for a memory issue to occur.)
Expected behavior
Either:
Eleventy should detect accidental layout recursion and stop the build immediately with an error message.
Or:
Eleventy should issue a performance warning after the n-th nested layout (n=10?) in general
Eleventy should stop the build with an error message after the n-th nested layout (n=?)
Environment:
OS and Version: macOS 10.15.4
Eleventy Version: 0.10.0
The text was updated successfully, but these errors were encountered:
Hmm, I'd rather say the first variant is easier to implement:
Have an array layouts, and whenever you process frontend matter with layout: ..., check if the layout is already in the layouts array stop immediately, otherwise store the layout name in the array.
And if you produce a loop within the template using the template language's include mechanisms, this should be handled by the template language parser itself.
Describe the bug
I ran into a loop during build because I was carelessly using search & replace in my code. 馃槈
To Reproduce
Create a layout
page.njk
with the frontend matterCreate a page using this layout
Run
npx eleventy
Eleventy seemed to be happy to oblige and I just noticed my mistake because the build seemed to run forever. (I didn't wait for a memory issue to occur.)
Expected behavior
Either:
Or:
Environment:
The text was updated successfully, but these errors were encountered: