Skip to content
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

Tried to use templateContent too early with v3.0.0-alpha #82

Open
krisdahl opened this issue Sep 6, 2024 · 1 comment
Open

Tried to use templateContent too early with v3.0.0-alpha #82

krisdahl opened this issue Sep 6, 2024 · 1 comment

Comments

@krisdahl
Copy link

krisdahl commented Sep 6, 2024

Error

Having trouble rendering njk template ./templates/sitemap.njk (via TemplateContentRenderError)
Tried to use templateContent too early on ./templates/labpost.njk (via TemplateContentPrematureUseError)
Original error stack trace: TemplateContentPrematureUseError: Tried to use templateContent too early on ./templates/template.njk
at Object.get [as templateContent] (file:///[path]/node_modules/@11ty/eleventy/src/Template.js:618:14)
at [path]/node_modules/@quasibit/eleventy-plugin-sitemap/src/paginationItems.js:20:5

I'm getting an error using the plain vanilla copy paste from documents. It seems to have something to do with the pagination of the collections. I tried to use eleventyImport to make sure the collections were loaded explictly without a difference.

I also tried creating a custom sitemap collection and use that but also got the error.

eleventy version 3.0.0-alpha.19, sitemap 2.2.0

@krisdahl
Copy link
Author

krisdahl commented Sep 6, 2024

To workaround I manually did a sitemap template based on this recipie: https://11ty.recipes/recipes/add-a-sitemap/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant