Use parsed symbols to inform content dependency rendering order (aka fix more “Tried to use templateContent too early” edge cases) #4170
Replies: 12 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 |
Beta Was this translation helpful? Give feedback.
-
|
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 |
Beta Was this translation helpful? Give feedback.
-
|
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, |
Beta Was this translation helpful? Give feedback.
-
|
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! |
Beta Was this translation helpful? Give feedback.
-
|
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! |
Beta Was this translation helpful? Give feedback.
-
|
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 |
Beta Was this translation helpful? Give feedback.
-
|
For me: eleventy/src/Engines/Liquid.js Line 207 in 1db6a10 eleventy/src/Engines/Nunjucks.js Line 369 in 1db6a10 |
Beta Was this translation helpful? Give feedback.
-
|
Related to #108 as well |
Beta Was this translation helpful? Give feedback.
-
|
@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 👍 |
Beta Was this translation helpful? Give feedback.
-
|
#975 is shipping with 2.0.0-canary.20 |
Beta Was this translation helpful? Give feedback.
-
|
Adding reference to text |
Beta Was this translation helpful? Give feedback.
-
|
Cross link to good workarounds at #1237 (comment) and #3483 (comment) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The build process sometimes ends with an exception
TemplateContentPrematureUseError.Steps to reproduce
Steps to reproduce the behavior:
/_site/tango/rss/index.njkThe 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.1Beta Was this translation helpful? Give feedback.
All reactions