-
-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eleventyComputed property with pagination is computed with empty data #2837
Comments
Could this be related to #2240? |
@AleksandrHovhannisyan yes, I think that's what happens here too. |
Stumbuled into this issue after updating to 2.0.1. This used to work on "2.0.0-canary.8", so I'm staying on that version. In my case, I've noticed it happens when using pagination + Permalink:
And then
But it will work with this setup `content/key.njk``:
|
Hi all, this is specifically a problem with nunjucks. If you change your templates to liquid, md, handlebars, etc... it will work properly and more info -> #3120 |
Ah, you're right. I was perhaps a bit brash thinking "pagination" and "eleventyComputed" would be the same issue as mine. for this case, the error is raised when eleventy tries to figure out what variables you use in your function (here), so it does some weird proxy stuff (here) which fails because as you say, on the first pass the |
Operating system
Fedora Linux 37 (Workstation edition)
Eleventy
2.0.0
Describe the bug
I stumbled across a weird issue that occurred only in one of the computed properties I defined in an
11data.js
directory data file. That property depended on another computed property. I have a few such dependencies, but in this particular one, the function received an empty data property and thus it would fail to compute a transormation of another computed property and the build would fail.After a bit of debugging, I discovered that it occurs when the permalink is set dynamically and reading the debug output, I saw that there is a "ghost" render of the template:
I ended up creating (what I think is) a minimal test case project where the same problem occurs. It's available here:
https://github.com/souserge/11ty-permalink-issue-example
The issue occurs in the
test/test.11tydata.js
file. The relevant bit is pasted below:Reproduction steps
DEBUG="Eleventy*" npx @11ty/eleventy
Expected behavior
The page isn't rendered without the data being available for computed properties
Reproduction URL
https://github.com/souserge/11ty-permalink-issue-example
Screenshots
The text was updated successfully, but these errors were encountered: