-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Use parsed symbols to inform content dependency rendering order (aka fix more “Tried to use templateContent too early” edge cases) #1615
Comments
When I add
I took the hint from the comments to #522. It still takes me by surprise because all of my collections are specified by the glob |
I suddenly started seeing this error too today. It does not happen on the initial build of It looks like the error comes from
I have Eleventy 1.0.0 and eleventy-plugin-rss 1.1.2 |
I am facing the exact same symptoms as @andeersg with eleventy 1.1.0 and eleventy-plugin-rss 1.1.2 and nunjucks template: Initial build is ok. Modifying a file in the Is there a workaround or something we can do about this? (I don't have a minimal example to reproduce but this repo exhibits the behavior: clone, |
I am having this issue too! In several for loops (e.g. Please, refer to this set of examples to reproduce the issue. Thanks a lot! |
What I've done to make it better in development is to enable the plugin only in the production build (
Hope that can help someone while a fix is found! |
Eleventy does its best to generated an ordered dependency graph of the content to generate https://www.11ty.dev/docs/advanced-order/ That said, there are some edge cases here, because we don’t yet take into account the AST of the templates to determine what they consume (only where they publish to), as noted on the docs above. One easy way to influence that order is to use I don’t think this has anything specifically to do with the RSS plugin, it’s just where the I was not able to reproduce from #1615 (comment) So, just to summarize: I will leave this one open as the home base for a more automated solution to parse the templates to see what collections they consume. But a more short-term solution will be #975 |
For me: eleventy/src/Engines/Liquid.js Line 207 in 1db6a10
eleventy/src/Engines/Nunjucks.js Line 369 in 1db6a10
|
Related to #108 as well |
@zachleat My bad in #1615 (comment) I should have linked to this commit because after that I disabled the feed template on local build to temporarily avoid the issue. I agree that the issues you linked seems like good solution options for this issue 👍 |
#975 is shipping with 2.0.0-canary.20 |
…use templateContent too early" Siehe auch 11ty/eleventy#1615 (comment)
The build process sometimes ends with an exception
TemplateContentPrematureUseError
.Steps to reproduce
Steps to reproduce the behavior:
/_site/tango/rss/index.njk
The build script invokes
.\node_modules\.bin\eleventy.cmd --output=./build
. This comes out on the command line:The first item in the stack trace (in which post this error occurs) changes from time to time. And sometimes, there is no error and everything works as expected.
When I remove this line from
/_site/tango/rss/index.njk
, there is no error:Expected behavior
The build process finishes normally
Environment:
0.11.1
The text was updated successfully, but these errors were encountered: